﻿namespace Sysmex.C150M.Analyze.Basics
{
    using Sysmex.C150M.Analyze;
    using Sysmex.C150M.MeasManager;
    using Sysmex.Core.Calculation;
    using Sysmex.Core.ComponentModel;
    using System;
    using System.Collections;
    using System.Runtime.Serialization;
    using System.Windows.Forms;

    [Serializable, AnaAlgo(0, "Percent analysis", "Percent analysis")]
    internal sealed class AnaAlgoPercent : AnaAlgoBase, IAnaAlgo, INaming, ISerializable
    {
        private int _agedMinuteTh;
        private bool _applyCorrectDH;
        private double _bH_SearchTime;
        private bool _bHAssume;
        private int _bHdeltaTH;
        private double _bHEnd;
        private double _bHendE;
        private double _bHendS;
        private double _bHslopeTh;
        private double _bHStart;
        private double _bHstartE;
        private double _bHstartS;
        private double _bHtime;
        private bool _ChangeWave_f;
        private bool _checkAgedSamp;
        private bool _checkDetectFlag;
        private bool _checkDipFlag;
        private bool _checkDriftFlag;
        private bool _checkEarlyFlag;
        private bool _checkFlatCurve;
        private bool _checkFlatLaterFlag;
        private int _checkIniDropKind;
        private bool _checkJumpFlag;
        private bool _checkNcFlag;
        private bool _checkNoEndFlag;
        private bool _checkNoiseFlag;
        private bool _checkRangeFlag;
        private bool _checkSAngleFlag;
        private bool _checkScFlag;
        private int _checkSDropKind;
        private int _checkSlowReacKind;
        private bool _checkStartProfile;
        private int _checkStepKind;
        private bool _checkTempFlag;
        private bool _checkTerraceFlag;
        private bool _checkTurbidityFlag;
        private int _coagCount;
        private int _coagDetCount;
        private int _coagDetPercent;
        private int _coagStartLevel;
        private int _derivative_Width;
        private bool _derivativeCurve;
        private int _detectLevelTh;
        private int _dhBase;
        private double _dhCor;
        private int _dhDis;
        private double _dhMaxtime;
        private int _dipCheckEnd;
        private int _dipCheckStart;
        private int _dipPointTh;
        private int _driftCheckPercent1;
        private int _driftCheckPercent2;
        private double _driftRatioLimit;
        private int _driftWidth;
        private int _earlyCheckPercent;
        private double _earlyPTimeTh;
        private int _endJudge_dH;
        private int _endJudge_dHCount;
        private int _endJudge_Height;
        private int _endJudge_kind;
        private double _endJudge_Rate;
        private int _endJudge_RateCount;
        private int _endJudge_Width;
        private bool _endJudgeTh_Flag;
        private double _fcCheckLimitSlope;
        private double _fcJudge_Width;
        private int _fewCoagCount;
        private int _fewCoagStartLevel;
        private double _iniDropCheckTime;
        private int _iniDropDeltaTh;
        private int _iniDropNdeltaTh;
        private double _iniDropNRateTh;
        private double _iniDropRatioTh;
        private int _jumpUpTh;
        private int _laterDhTh;
        private double _laterSecTh;
        private double _maskTime;
        private int _medien_AfterP;
        private int _medien_BeforeP;
        private double _minReportTime;
        private int _ncTH;
        private int _noiseLevelTh;
        private int _noiseSD;
        private int _photometricTime;
        private bool _refTranFlag;
        private double _sangleCheckTime1;
        private double _sangleCheckTime2;
        private int _sangleDeltaTh;
        private int _sangleDhTh;
        private int _scTH;
        private double _sdropLevelTh;
        private int _sdropTh;
        private int _shiftAve_AfterP;
        private int _shiftAve_BeforeP;
        private bool _smoothFlag_Medien;
        private bool _smoothFlag_ShiftAve;
        private double _spCheckLimitRatio;
        private double _spCheckTime1;
        private double _spCheckTime2;
        private int _srCheckWidth;
        private int _srNCheckWidth;
        private double _srNWidthMinSpeed;
        private double _srWidthMaxTime;
        private int _stepCheckDiffTh;
        private double _stepCheckRatioTh;
        private double _stepCheckTime1;
        private double _stepCheckTime2;
        private double _stepRateTh;
        private uint _subWave;
        private int _tempValue;
        private int _terraceCheckEnd;
        private int _terraceCheckStart;
        private double _terraceTh;
        private int _turbidityLevelTh;
        private bool AnaAlgoBase_x002B_applyCalibFomura0;
        private bool AnaAlgoBase_x002B_applyCalibFomura1;
        private bool AnaAlgoBase_x002B_applyCalibReag;
        private double AnaAlgoBase_x002B_calibFomura0MicroValA;
        private double AnaAlgoBase_x002B_calibFomura0MicroValB;
        private double AnaAlgoBase_x002B_calibFomura0ValA;
        private double AnaAlgoBase_x002B_calibFomura0ValB;
        private double AnaAlgoBase_x002B_calibFomura1ValA;
        private double AnaAlgoBase_x002B_calibFomura1ValB;
        private double AnaAlgoBase_x002B_calibReagValA;
        private double AnaAlgoBase_x002B_calibReagValB;
        private uint AnaAlgoBase_x002B_detMethod;
        private uint AnaAlgoBase_x002B_detOptGain;
        private uint AnaAlgoBase_x002B_detOptKind;
        private uint AnaAlgoBase_x002B_detOptWave;
        private bool AnaAlgoBase_x002B_microFlag;
        private byte AnaAlgoBase_x002B_sampleKind;
        private string AnaPerecntVersion;

        public AnaAlgoPercent()
        {
            this.AnaPerecntVersion = "1.00";
            this.Set_AnaParamDef();
            this.Set_AnaCheckParamDef();
            this.Set_DHparamDef();
        }

        public AnaAlgoPercent(SerializationInfo info, StreamingContext context)
        {
            this.AnaPerecntVersion = "1.00";
            if (info == null)
            {
                throw new ArgumentNullException("info in AnaAlgoPercent");
            }
            Hashtable hashtable = new Hashtable();
            this.GetObjectMember(hashtable);
            SerializationInfoEnumerator enumerator = info.GetEnumerator();
            while (enumerator.MoveNext())
            {
                SerializationEntry current = enumerator.Current;
                try
                {
                    if (!hashtable.Contains(current.Name))
                    {
                        throw new SerializationException("メンバ名 '" + current.Name + "' が見つかりませんでした。");
                    }
                }
                catch (Exception)
                {
                    throw new SerializationException("メンバ名 '" + current.Name + "' が見つかりませんでした。");
                }
            }
            this._refTranFlag = info.GetBoolean("_refTranFlag");
            this._smoothFlag_Medien = info.GetBoolean("_smoothFlag_Medien");
            this._medien_BeforeP = info.GetInt32("_medien_BeforeP");
            this._medien_AfterP = info.GetInt32("_medien_AfterP");
            this._smoothFlag_ShiftAve = info.GetBoolean("_smoothFlag_ShiftAve");
            this._shiftAve_BeforeP = info.GetInt32("_shiftAve_BeforeP");
            this._shiftAve_AfterP = info.GetInt32("_shiftAve_AfterP");
            this._maskTime = info.GetDouble("_maskTime");
            this._bH_SearchTime = info.GetDouble("_bH_SearchTime");
            this._fewCoagStartLevel = info.GetInt32("_fewCoagStartLevel");
            this._fewCoagCount = info.GetInt32("_fewCoagCount");
            this._coagStartLevel = info.GetInt32("_coagStartLevel");
            this._coagCount = info.GetInt32("_coagCount");
            this._endJudge_kind = info.GetInt32("_endJudge_kind");
            this._endJudge_Width = info.GetInt32("_endJudge_Width");
            this._endJudge_Height = info.GetInt32("_endJudge_Height");
            this._endJudge_Rate = info.GetDouble("_endJudge_Rate");
            this._endJudge_RateCount = info.GetInt32("_endJudge_RateCount");
            this._endJudgeTh_Flag = info.GetBoolean("_endJudgeTh_Flag");
            this._endJudge_dH = info.GetInt32("_endJudge_dH");
            this._endJudge_dHCount = info.GetInt32("_endJudge_dHCount");
            this._coagDetCount = info.GetInt32("_coagDetCount");
            this._coagDetPercent = info.GetInt32("_coagDetPercent");
            this._ChangeWave_f = info.GetBoolean("_ChangeWave_f");
            this._subWave = info.GetUInt32("_subWave");
            this._bHAssume = info.GetBoolean("_bHAssume");
            this._bHstartS = info.GetDouble("_bHstartS");
            this._bHendS = info.GetDouble("_bHendS");
            this._bHstartE = info.GetDouble("_bHstartE");
            this._bHendE = info.GetDouble("_bHendE");
            this._bHStart = info.GetDouble("_bHStart");
            this._bHEnd = info.GetDouble("_bHEnd");
            this._bHdeltaTH = info.GetInt32("_bHdeltaTH");
            this._bHslopeTh = info.GetDouble("_bHslopeTh");
            this._bHtime = info.GetDouble("_bHtime");
            this._checkTempFlag = info.GetBoolean("_checkTempFlag");
            this._tempValue = info.GetInt32("_tempValue");
            this._checkAgedSamp = info.GetBoolean("_checkAgedSamp");
            this._agedMinuteTh = info.GetInt32("_agedMinuteTh");
            this._checkScFlag = info.GetBoolean("_checkScFlag");
            this._scTH = info.GetInt32("_scTH");
            this._checkNoEndFlag = info.GetBoolean("_checkNoEndFlag");
            this._checkIniDropKind = info.GetInt32("_checkIniDropKind");
            this._iniDropCheckTime = info.GetDouble("_iniDropCheckTime");
            this._iniDropDeltaTh = info.GetInt32("_iniDropDeltaTh");
            this._iniDropRatioTh = info.GetDouble("_iniDropRatioTh");
            this._iniDropNdeltaTh = info.GetInt32("_iniDropNdeltaTh");
            this._iniDropNRateTh = info.GetDouble("_iniDropNRateTh");
            this._checkSDropKind = info.GetInt32("_checkSDropKind");
            this._sdropTh = info.GetInt32("_sdropTh");
            this._sdropLevelTh = info.GetDouble("_sdropLevelTh");
            this._checkDipFlag = info.GetBoolean("_checkDipFlag");
            this._dipCheckStart = info.GetInt32("_dipCheckStart");
            this._dipCheckEnd = info.GetInt32("_dipCheckEnd");
            this._dipPointTh = info.GetInt32("_dipPointTh");
            this._checkJumpFlag = info.GetBoolean("_checkJumpFlag");
            this._jumpUpTh = info.GetInt32("_jumpUpTh");
            this._checkStepKind = info.GetInt32("_checkStepKind");
            this._stepCheckTime1 = info.GetDouble("_stepCheckTime1");
            this._stepCheckTime2 = info.GetDouble("_stepCheckTime2");
            this._stepCheckRatioTh = info.GetDouble("_stepCheckRatioTh");
            this._stepCheckDiffTh = info.GetInt32("_stepCheckDiffTh");
            this._stepRateTh = info.GetDouble("_stepRateTh");
            this._checkFlatLaterFlag = info.GetBoolean("_checkFlatLaterFlag");
            this._laterSecTh = info.GetDouble("_laterSecTh");
            this._laterDhTh = info.GetInt32("_laterDhTh");
            this._checkTerraceFlag = info.GetBoolean("_checkTerraceFlag");
            this._terraceCheckStart = info.GetInt32("_terraceCheckStart");
            this._terraceCheckEnd = info.GetInt32("_terraceCheckEnd");
            this._terraceTh = info.GetDouble("_terraceTh");
            this._checkTurbidityFlag = info.GetBoolean("_checkTurbidityFlag");
            this._turbidityLevelTh = info.GetInt32("_turbidityLevelTh");
            this._checkNcFlag = info.GetBoolean("_checkNcFlag");
            this._ncTH = info.GetInt32("_ncTH");
            this._checkRangeFlag = info.GetBoolean("_checkRangeFlag");
            this._minReportTime = info.GetDouble("_minReportTime");
            this._checkNoiseFlag = info.GetBoolean("_checkNoiseFlag");
            this._noiseSD = info.GetInt32("_noiseSD");
            this._noiseLevelTh = info.GetInt32("_noiseLevelTh");
            this._checkDetectFlag = info.GetBoolean("_checkDetectFlag");
            this._detectLevelTh = info.GetInt32("_detectLevelTh");
            this._checkSlowReacKind = info.GetInt32("_checkSlowReacKind");
            this._srCheckWidth = info.GetInt32("_srCheckWidth");
            this._srWidthMaxTime = info.GetDouble("_srWidthMaxTime");
            this._srNCheckWidth = info.GetInt32("_srNCheckWidth");
            this._srNWidthMinSpeed = info.GetDouble("_srNWidthMinSpeed");
            this._checkSAngleFlag = info.GetBoolean("_checkSAngleFlag");
            this._sangleCheckTime1 = info.GetDouble("_sangleCheckTime1");
            this._sangleCheckTime2 = info.GetDouble("_sangleCheckTime2");
            this._sangleDeltaTh = info.GetInt32("_sangleDeltaTh");
            this._sangleDhTh = info.GetInt32("_sangleDhTh");
            this._checkDriftFlag = info.GetBoolean("_checkDriftFlag");
            this._driftCheckPercent1 = info.GetInt32("_driftCheckPercent1");
            this._driftCheckPercent2 = info.GetInt32("_driftCheckPercent2");
            this._driftWidth = info.GetInt32("_driftWidth");
            this._driftRatioLimit = info.GetDouble("_driftRatioLimit");
            this._checkEarlyFlag = info.GetBoolean("_checkEarlyFlag");
            this._earlyCheckPercent = info.GetInt32("_earlyCheckPercent");
            this._earlyPTimeTh = info.GetDouble("_earlyPTimeTh");
            this._applyCorrectDH = info.GetBoolean("_applyCorrectDH");
            this._dhBase = info.GetInt32("_dhBase");
            this._dhDis = info.GetInt32("_dhDis");
            this._dhCor = info.GetDouble("_dhCor");
            this._dhMaxtime = info.GetDouble("_dhMaxtime");
            base.DetMethod = info.GetUInt32("detMethod");
            base.DetOptWave = info.GetUInt32("detOptWave");
            base.DetOptKind = info.GetUInt32("detOptKind");
            base.DetOptGain = info.GetUInt32("detOptGain");
            base.sampleKind = info.GetByte("sampleKind");
            base.microFlag = info.GetBoolean("microFlag");
            base.applyCalibReag = info.GetBoolean("applyCalibReag");
            base.calibReagValA = info.GetDouble("calibReagValA");
            base.calibReagValB = info.GetDouble("calibReagValB");
            base.applyCalibFomura0 = info.GetBoolean("applyCalibFomura0");
            base.calibFomura0ValA = info.GetDouble("calibFomura0ValA");
            base.calibFomura0ValB = info.GetDouble("calibFomura0ValB");
            base.calibFomura0MicroValA = info.GetDouble("calibFomura0MicroValA");
            base.calibFomura0MicroValB = info.GetDouble("calibFomura0MicroValB");
            base.applyCalibFomura1 = info.GetBoolean("applyCalibFomura1");
            base.calibFomura1ValA = info.GetDouble("calibFomura1ValA");
            base.calibFomura1ValB = info.GetDouble("calibFomura1ValB");
            this.AnaAlgoBase_x002B_detMethod = info.GetUInt32("AnaAlgoBase+detMethod");
            this.AnaAlgoBase_x002B_detOptWave = info.GetUInt32("AnaAlgoBase+detOptWave");
            this.AnaAlgoBase_x002B_detOptKind = info.GetUInt32("AnaAlgoBase+detOptKind");
            this.AnaAlgoBase_x002B_detOptGain = info.GetUInt32("AnaAlgoBase+detOptGain");
            this.AnaAlgoBase_x002B_sampleKind = info.GetByte("AnaAlgoBase+sampleKind");
            this.AnaAlgoBase_x002B_microFlag = info.GetBoolean("AnaAlgoBase+microFlag");
            this.AnaAlgoBase_x002B_applyCalibReag = info.GetBoolean("AnaAlgoBase+applyCalibReag");
            this.AnaAlgoBase_x002B_calibReagValA = info.GetDouble("AnaAlgoBase+calibReagValA");
            this.AnaAlgoBase_x002B_calibReagValB = info.GetDouble("AnaAlgoBase+calibReagValB");
            this.AnaAlgoBase_x002B_applyCalibFomura0 = info.GetBoolean("AnaAlgoBase+applyCalibFomura0");
            this.AnaAlgoBase_x002B_calibFomura0ValA = info.GetDouble("AnaAlgoBase+calibFomura0ValA");
            this.AnaAlgoBase_x002B_calibFomura0ValB = info.GetDouble("AnaAlgoBase+calibFomura0ValB");
            this.AnaAlgoBase_x002B_calibFomura0MicroValA = info.GetDouble("AnaAlgoBase+calibFomura0MicroValA");
            this.AnaAlgoBase_x002B_calibFomura0MicroValB = info.GetDouble("AnaAlgoBase+calibFomura0MicroValB");
            this.AnaAlgoBase_x002B_applyCalibFomura1 = info.GetBoolean("AnaAlgoBase+applyCalibFomura1");
            this.AnaAlgoBase_x002B_calibFomura1ValA = info.GetDouble("AnaAlgoBase+calibFomura1ValA");
            this.AnaAlgoBase_x002B_calibFomura1ValB = info.GetDouble("AnaAlgoBase+calibFomura1ValB");
            try
            {
                this._checkStartProfile = info.GetBoolean("_checkStartProfile");
                this._spCheckTime1 = info.GetDouble("_spCheckTime1");
                this._spCheckTime2 = info.GetDouble("_spCheckTime2");
                this._spCheckLimitRatio = info.GetDouble("_spCheckLimitRatio");
            }
            catch (SerializationException)
            {
                this._checkStartProfile = false;
                this._spCheckTime1 = 3.0;
                this._spCheckTime2 = 5.0;
                this._spCheckLimitRatio = 0.4;
            }
            try
            {
                this._checkFlatCurve = info.GetBoolean("_checkFlatCurve");
                this._fcCheckLimitSlope = info.GetDouble("_fcCheckLimitSlope");
                this._fcJudge_Width = info.GetDouble("_fcJudge_Width");
            }
            catch (SerializationException)
            {
                this._checkFlatCurve = false;
                this._fcCheckLimitSlope = 11.0;
                this._fcJudge_Width = 2.0;
            }
            try
            {
                this._derivativeCurve = info.GetBoolean("_derivativeCurve");
                this._derivative_Width = info.GetInt32("_derivative_Width");
            }
            catch (SerializationException)
            {
                this._derivativeCurve = false;
                this._derivative_Width = 60;
            }
            try
            {
                this._photometricTime = info.GetInt32("_photometricTime");
            }
            catch
            {
                this._photometricTime = 360;
            }
        }

        public IAnaAlgo AnaAlgoClone()
        {
            return new AnaAlgoPercent { 
                AnaPerecntVersion = this.AnaPerecntVersion, RefTranFlag = this.RefTranFlag, SmoothFlag_Medien = this.SmoothFlag_Medien, Medien_BeforeP = this.Medien_BeforeP, Medien_AfterP = this.Medien_AfterP, SmoothFlag_ShiftAve = this.SmoothFlag_ShiftAve, ShiftAve_BeforeP = this.ShiftAve_BeforeP, ShiftAve_AfterP = this.ShiftAve_AfterP, MaskTime = this.MaskTime, bH_SearchTime = this.bH_SearchTime, FewCoagStartLevel = this.FewCoagStartLevel, FewCoagCount = this.FewCoagCount, CoagStartLevel = this.CoagStartLevel, CoagCount = this.CoagCount, EndJudge_Kind = this.EndJudge_Kind, EndJudge1_Width = this.EndJudge1_Width, 
                EndJudge1_Height = this.EndJudge1_Height, EndJudge2_Rate = this.EndJudge2_Rate, EndJudge2_RateCount = this.EndJudge2_RateCount, EndJudgeTh_Flag = this.EndJudgeTh_Flag, EndJudge_dH = this.EndJudge_dH, EndJudge_dHCount = this.EndJudge_dHCount, CoagDetCount = this.CoagDetCount, CoagDetPercent = this.CoagDetPercent, ChangeWave_f = this.ChangeWave_f, SubWave = this.SubWave, BHassume = this.BHassume, BHstartS = this.BHstartS, BHendS = this.BHendS, BHstartE = this.BHstartE, BHendE = this.BHendE, BHStart = this.BHStart, 
                BHdeltaTH = this.BHdeltaTH, BHslopeTH = this.BHslopeTH, BHtime = this.BHtime, DerivativeCurve = this.DerivativeCurve, Derivative_Width = this.Derivative_Width, CheckTemp_flag = this.CheckTemp_flag, TempValue = this.TempValue, CheckAgedSamp_flag = this.CheckAgedSamp_flag, AgedMinute_th = this.AgedMinute_th, CheckSC_flag = this.CheckSC_flag, SC_th = this.SC_th, CheckNoEnd_flag = this.CheckNoEnd_flag, CheckIniDrop_kind = this.CheckIniDrop_kind, IniDropCheck_time = this.IniDropCheck_time, IniDropDelta_th = this.IniDropDelta_th, IniDropRatio_th = this.IniDropRatio_th, 
                IniDropNDelta_th = this.IniDropNDelta_th, IniDropNRate_th = this.IniDropNRate_th, CheckSDrop_kind = this.CheckSDrop_kind, SDrop_th = this.SDrop_th, SDropLevel_th = this.SDropLevel_th, CheckDip_flag = this.CheckDip_flag, DipCheckStart = this.DipCheckStart, DipCheckEnd = this.DipCheckEnd, DipPoint_th = this.DipPoint_th, CheckJump_flag = this.CheckJump_flag, JumpUp_th = this.JumpUp_th, CheckStep_kind = this.CheckStep_kind, StepCheck_time1 = this.StepCheck_time1, StepCheck_time2 = this.StepCheck_time2, StepCheckRatio_th = this.StepCheckRatio_th, StepCheckDiff_th = this.StepCheckDiff_th, 
                StepRate_th = this.StepRate_th, CheckFlatLater_flag = this.CheckFlatLater_flag, LaterSec_th = this.LaterSec_th, LaterDh_th = this.LaterDh_th, CheckTerrace_flag = this.CheckTerrace_flag, TerraceCheckStart = this.TerraceCheckStart, TerraceCheckEnd = this.TerraceCheckEnd, Terrace_th = this.Terrace_th, CheckTurbidity_flag = this.CheckTurbidity_flag, TurbidityLevel_th = this.TurbidityLevel_th, CheckNC_flag = this.CheckNC_flag, NC_th = this.NC_th, CheckRange_flag = this.CheckRange_flag, MinReport_time = this.MinReport_time, CheckNoise_flag = this.CheckNoise_flag, NoiseSD = this.NoiseSD, 
                NoiseLvel_th = this.NoiseLvel_th, CheckDetect_flag = this.CheckDetect_flag, DetectLevel_th = this.DetectLevel_th, CheckSlowReac_kind = this.CheckSlowReac_kind, SRcheckWidth = this.SRcheckWidth, SRwidthMaxTime = this.SRwidthMaxTime, SR2Ratio = this.SR2Ratio, CheckSAngle_flag = this.CheckSAngle_flag, SAngleCheck_time1 = this.SAngleCheck_time1, SAngleCheck_time2 = this.SAngleCheck_time2, SAngleDelta_th = this.SAngleDelta_th, SAngleDH_th = this.SAngleDH_th, _checkStartProfile = this.CheckStartProfile, _spCheckTime1 = this.SPcheckTime1, _spCheckTime2 = this.SPcheckTime2, _spCheckLimitRatio = this.SPcheckLimitRatio, 
                _checkFlatCurve = this.CheckFlatCurve, _fcCheckLimitSlope = this.FCcheckLimitSlope, _fcJudge_Width = this.FCjudge_Width, _photometricTime = this.PhotometricTime, CheckDrift_flag = this.CheckDrift_flag, DriftCheckPercent1 = this.DriftCheckPercent1, DriftCheckPercent2 = this.DriftCheckPercent2, DriftWidth = this.DriftWidth, DriftRatio_limit = this.DriftRatio_limit, CheckEarly_falg = this.CheckEarly_falg, EarlyCheckPercent = this.EarlyCheckPercent, EarlyPtime_th = this.EarlyPtime_th, DetMethod = base.DetMethod, DetOptWave = base.DetOptWave, DetOptGain = base.DetOptGain, DetOptKind = base.DetOptKind, 
                ApplyCalibFomura0 = base.ApplyCalibFomura0, CalibFomura0ValA = base.CalibFomura0ValA, CalibFomura0ValB = base.CalibFomura0ValB, CalibFomura0MicroValA = base.CalibFomura0MicroValA, CalibFomura0MicroValB = base.CalibFomura0MicroValB, ApplyCalibFomura1 = base.ApplyCalibFomura1, CalibFomura1ValA = base.CalibFomura1ValA, CalibFomura1ValB = base.CalibFomura1ValB, microFlag = base.microFlag, AnaAlgoBase_x002B_applyCalibFomura0 = this.AnaAlgoBase_x002B_applyCalibFomura0, AnaAlgoBase_x002B_applyCalibFomura1 = this.AnaAlgoBase_x002B_applyCalibFomura1, AnaAlgoBase_x002B_applyCalibReag = this.AnaAlgoBase_x002B_applyCalibReag, AnaAlgoBase_x002B_calibFomura0MicroValA = this.AnaAlgoBase_x002B_calibFomura0MicroValA, AnaAlgoBase_x002B_calibFomura0MicroValB = this.AnaAlgoBase_x002B_calibFomura0MicroValB, AnaAlgoBase_x002B_calibFomura0ValA = this.AnaAlgoBase_x002B_calibFomura0ValA, AnaAlgoBase_x002B_calibFomura0ValB = this.AnaAlgoBase_x002B_calibFomura0ValB, 
                AnaAlgoBase_x002B_calibFomura1ValA = this.AnaAlgoBase_x002B_calibFomura1ValA, AnaAlgoBase_x002B_calibFomura1ValB = this.AnaAlgoBase_x002B_calibFomura1ValB, AnaAlgoBase_x002B_calibReagValA = this.AnaAlgoBase_x002B_calibReagValA, AnaAlgoBase_x002B_calibReagValB = this.AnaAlgoBase_x002B_calibReagValB, AnaAlgoBase_x002B_detMethod = this.AnaAlgoBase_x002B_detMethod, AnaAlgoBase_x002B_detOptGain = this.AnaAlgoBase_x002B_detOptGain, AnaAlgoBase_x002B_detOptKind = this.AnaAlgoBase_x002B_detOptKind, AnaAlgoBase_x002B_detOptWave = this.AnaAlgoBase_x002B_detOptWave, AnaAlgoBase_x002B_microFlag = this.AnaAlgoBase_x002B_microFlag, AnaAlgoBase_x002B_sampleKind = this.AnaAlgoBase_x002B_sampleKind, ApplyCalibReag = base.ApplyCalibReag, CalibReagA = base.CalibReagA, CalibReagValB = base.CalibReagValB, ApplyCorrectDH = this.ApplyCorrectDH, DH_BASE = this.DH_BASE, DH_COR = this.DH_COR, 
                DH_DIS = this.DH_DIS, DH_MAXTIME = this.DH_MAXTIME
             };
        }

        public IAnaResult Analyze(IRawData rd)
        {
            IAnaResult result;
            AnaWorkPercent percent = new AnaWorkPercent();
            try
            {
                result = percent.Analyze(this, rd);
            }
            catch (Exception exception)
            {
                throw new AnalyzeException(exception, "解析エラー");
            }
            return result;
        }

        public ISettingForm CreateForm(bool isIPU)
        {
            return new AnaAlgoPercentForm(this, isIPU);
        }

        private void GetObjectMember(Hashtable info)
        {
            if (info == null)
            {
                throw new ArgumentNullException("info in GetObjectMember");
            }
            info.Add("AnaPerecntVersion", this.AnaPerecntVersion);
            info.Add("_refTranFlag", this._refTranFlag);
            info.Add("_smoothFlag_Medien", this._smoothFlag_Medien);
            info.Add("_medien_BeforeP", this._medien_BeforeP);
            info.Add("_medien_AfterP", this._medien_AfterP);
            info.Add("_smoothFlag_ShiftAve", this._smoothFlag_ShiftAve);
            info.Add("_shiftAve_BeforeP", this._shiftAve_BeforeP);
            info.Add("_shiftAve_AfterP", this._shiftAve_AfterP);
            info.Add("_maskTime", this._maskTime);
            info.Add("_bH_SearchTime", this._bH_SearchTime);
            info.Add("_fewCoagStartLevel", this._fewCoagStartLevel);
            info.Add("_fewCoagCount", this._fewCoagCount);
            info.Add("_coagStartLevel", this._coagStartLevel);
            info.Add("_coagCount", this._coagCount);
            info.Add("_endJudge_kind", this._endJudge_kind);
            info.Add("_endJudge_Width", this._endJudge_Width);
            info.Add("_endJudge_Height", this._endJudge_Height);
            info.Add("_endJudge_Rate", this._endJudge_Rate);
            info.Add("_endJudge_RateCount", this._endJudge_RateCount);
            info.Add("_endJudgeTh_Flag", this._endJudgeTh_Flag);
            info.Add("_endJudge_dH", this._endJudge_dH);
            info.Add("_endJudge_dHCount", this._endJudge_dHCount);
            info.Add("_coagDetCount", this._coagDetCount);
            info.Add("_coagDetPercent", this._coagDetPercent);
            info.Add("_ChangeWave_f", this._ChangeWave_f);
            info.Add("_subWave", this._subWave);
            info.Add("_bHAssume", this._bHAssume);
            info.Add("_bHstartS", this._bHstartS);
            info.Add("_bHendS", this._bHendS);
            info.Add("_bHstartE", this._bHstartE);
            info.Add("_bHendE", this._bHendE);
            info.Add("_bHStart", this._bHStart);
            info.Add("_bHEnd", this._bHEnd);
            info.Add("_bHdeltaTH", this._bHdeltaTH);
            info.Add("_bHslopeTh", this._bHslopeTh);
            info.Add("_bHtime", this._bHtime);
            info.Add("_derivativeCurve", this._derivativeCurve);
            info.Add("_derivative_Width", this._derivative_Width);
            info.Add("_checkTempFlag", this._checkTempFlag);
            info.Add("_tempValue", this._tempValue);
            info.Add("_checkAgedSamp", this._checkAgedSamp);
            info.Add("_agedMinuteTh", this._agedMinuteTh);
            info.Add("_checkScFlag", this._checkScFlag);
            info.Add("_scTH", this._scTH);
            info.Add("_checkNoEndFlag", this._checkNoEndFlag);
            info.Add("_checkIniDropKind", this._checkIniDropKind);
            info.Add("_iniDropCheckTime", this._iniDropCheckTime);
            info.Add("_iniDropDeltaTh", this._iniDropDeltaTh);
            info.Add("_iniDropRatioTh", this._iniDropRatioTh);
            info.Add("_iniDropNdeltaTh", this._iniDropNdeltaTh);
            info.Add("_iniDropNRateTh", this._iniDropNRateTh);
            info.Add("_checkSDropKind", this._checkSDropKind);
            info.Add("_sdropTh", this._sdropTh);
            info.Add("_sdropLevelTh", this._sdropLevelTh);
            info.Add("_checkDipFlag", this._checkDipFlag);
            info.Add("_dipCheckStart", this._dipCheckStart);
            info.Add("_dipCheckEnd", this._dipCheckEnd);
            info.Add("_dipPointTh", this._dipPointTh);
            info.Add("_checkJumpFlag", this._checkJumpFlag);
            info.Add("_jumpUpTh", this._jumpUpTh);
            info.Add("_checkStepKind", this._checkStepKind);
            info.Add("_stepCheckTime1", this._stepCheckTime1);
            info.Add("_stepCheckTime2", this._stepCheckTime2);
            info.Add("_stepCheckRatioTh", this._stepCheckRatioTh);
            info.Add("_stepCheckDiffTh", this._stepCheckDiffTh);
            info.Add("_stepRateTh", this._stepRateTh);
            info.Add("_checkFlatLaterFlag", this._checkFlatLaterFlag);
            info.Add("_laterSecTh", this._laterSecTh);
            info.Add("_laterDhTh", this._laterDhTh);
            info.Add("_checkTerraceFlag", this._checkTerraceFlag);
            info.Add("_terraceCheckStart", this._terraceCheckStart);
            info.Add("_terraceCheckEnd", this._terraceCheckEnd);
            info.Add("_terraceTh", this._terraceTh);
            info.Add("_checkTurbidityFlag", this._checkTurbidityFlag);
            info.Add("_turbidityLevelTh", this._turbidityLevelTh);
            info.Add("_checkNcFlag", this._checkNcFlag);
            info.Add("_ncTH", this._ncTH);
            info.Add("_checkRangeFlag", this._checkRangeFlag);
            info.Add("_minReportTime", this._minReportTime);
            info.Add("_checkNoiseFlag", this._checkNoiseFlag);
            info.Add("_noiseSD", this._noiseSD);
            info.Add("_noiseLevelTh", this._noiseLevelTh);
            info.Add("_checkDetectFlag", this._checkDetectFlag);
            info.Add("_detectLevelTh", this._detectLevelTh);
            info.Add("_checkSlowReacKind", this._checkSlowReacKind);
            info.Add("_srCheckWidth", this._srCheckWidth);
            info.Add("_srWidthMaxTime", this._srWidthMaxTime);
            info.Add("_srNCheckWidth", this._srNCheckWidth);
            info.Add("_srNWidthMinSpeed", this._srNWidthMinSpeed);
            info.Add("_checkSAngleFlag", this._checkSAngleFlag);
            info.Add("_sangleCheckTime1", this._sangleCheckTime1);
            info.Add("_sangleCheckTime2", this._sangleCheckTime2);
            info.Add("_sangleDeltaTh", this._sangleDeltaTh);
            info.Add("_sangleDhTh", this._sangleDhTh);
            info.Add("_checkStartProfile", this._checkStartProfile);
            info.Add("_spCheckTime1", this._spCheckTime1);
            info.Add("_spCheckTime2", this._spCheckTime2);
            info.Add("_spCheckLimitRatio", this._spCheckLimitRatio);
            info.Add("_checkFlatCurve", this._checkFlatCurve);
            info.Add("_fcCheckLimitSlope", this._fcCheckLimitSlope);
            info.Add("_fcJudge_Width", this._fcJudge_Width);
            info.Add("_photometricTime", this._photometricTime);
            info.Add("_checkDriftFlag", this._checkDriftFlag);
            info.Add("_driftCheckPercent1", this._driftCheckPercent1);
            info.Add("_driftCheckPercent2", this._driftCheckPercent2);
            info.Add("_driftWidth", this._driftWidth);
            info.Add("_driftRatioLimit", this._driftRatioLimit);
            info.Add("_checkEarlyFlag", this._checkEarlyFlag);
            info.Add("_earlyCheckPercent", this._earlyCheckPercent);
            info.Add("_earlyPTimeTh", this._earlyPTimeTh);
            info.Add("_applyCorrectDH", this._applyCorrectDH);
            info.Add("_dhBase", this._dhBase);
            info.Add("_dhDis", this._dhDis);
            info.Add("_dhCor", this._dhCor);
            info.Add("_dhMaxtime", this._dhMaxtime);
            info.Add("detMethod", base.DetMethod);
            info.Add("detOptWave", base.DetOptWave);
            info.Add("detOptKind", base.DetOptKind);
            info.Add("detOptGain", base.DetOptGain);
            info.Add("sampleKind", base.sampleKind);
            info.Add("microFlag", base.microFlag);
            info.Add("applyCalibReag", base.applyCalibReag);
            info.Add("calibReagValA", base.calibReagValA);
            info.Add("calibReagValB", base.calibReagValB);
            info.Add("applyCalibFomura0", base.applyCalibFomura0);
            info.Add("calibFomura0ValA", base.calibFomura0ValA);
            info.Add("calibFomura0ValB", base.calibFomura0ValB);
            info.Add("calibFomura0MicroValA", base.calibFomura0MicroValA);
            info.Add("calibFomura0MicroValB", base.calibFomura0MicroValB);
            info.Add("applyCalibFomura1", base.applyCalibFomura1);
            info.Add("calibFomura1ValA", base.calibFomura1ValA);
            info.Add("calibFomura1ValB", base.calibFomura1ValB);
            info.Add("AnaAlgoBase+detMethod", this.AnaAlgoBase_x002B_detMethod);
            info.Add("AnaAlgoBase+detOptWave", this.AnaAlgoBase_x002B_detOptWave);
            info.Add("AnaAlgoBase+detOptKind", this.AnaAlgoBase_x002B_detOptKind);
            info.Add("AnaAlgoBase+detOptGain", this.AnaAlgoBase_x002B_detOptGain);
            info.Add("AnaAlgoBase+sampleKind", this.AnaAlgoBase_x002B_sampleKind);
            info.Add("AnaAlgoBase+microFlag", this.AnaAlgoBase_x002B_microFlag);
            info.Add("AnaAlgoBase+applyCalibReag", this.AnaAlgoBase_x002B_applyCalibReag);
            info.Add("AnaAlgoBase+calibReagValA", this.AnaAlgoBase_x002B_calibReagValA);
            info.Add("AnaAlgoBase+calibReagValB", this.AnaAlgoBase_x002B_calibReagValB);
            info.Add("AnaAlgoBase+applyCalibFomura0", this.AnaAlgoBase_x002B_applyCalibFomura0);
            info.Add("AnaAlgoBase+calibFomura0ValA", this.AnaAlgoBase_x002B_calibFomura0ValA);
            info.Add("AnaAlgoBase+calibFomura0ValB", this.AnaAlgoBase_x002B_calibFomura0ValB);
            info.Add("AnaAlgoBase+calibFomura0MicroValA", this.AnaAlgoBase_x002B_calibFomura0MicroValA);
            info.Add("AnaAlgoBase+calibFomura0MicroValB", this.AnaAlgoBase_x002B_calibFomura0MicroValB);
            info.Add("AnaAlgoBase+applyCalibFomura1", this.AnaAlgoBase_x002B_applyCalibFomura1);
            info.Add("AnaAlgoBase+calibFomura1ValA", this.AnaAlgoBase_x002B_calibFomura1ValA);
            info.Add("AnaAlgoBase+calibFomura1ValB", this.AnaAlgoBase_x002B_calibFomura1ValB);
        }

        private void Set_AnaCheckParamDef()
        {
            this._checkTempFlag = false;
            this._tempValue = 0x23;
            this._checkAgedSamp = true;
            this._agedMinuteTh = 60;
            this._checkScFlag = true;
            this._scTH = 20;
            this._checkNoEndFlag = true;
            this._checkIniDropKind = 1;
            this._iniDropCheckTime = 4.0;
            this._iniDropRatioTh = 0.2;
            this._iniDropDeltaTh = 480;
            this._iniDropNdeltaTh = 480;
            this._iniDropNRateTh = 0.2;
            this._checkSDropKind = 1;
            this._sdropTh = 0x20;
            this._sdropLevelTh = 0.2;
            this._checkDipFlag = true;
            this._dipCheckStart = 20;
            this._dipCheckEnd = 70;
            this._dipPointTh = 10;
            this._checkJumpFlag = true;
            this._jumpUpTh = 10;
            this._checkStepKind = 1;
            this._stepCheckTime1 = 80.0;
            this._stepCheckTime2 = 200.0;
            this._stepCheckRatioTh = 1.1;
            this._stepCheckDiffTh = 120;
            this._stepRateTh = 1.5;
            this._checkFlatLaterFlag = true;
            this._laterSecTh = 50.0;
            this._laterDhTh = 0xa8;
            this._checkTerraceFlag = false;
            this._terraceCheckStart = 20;
            this._terraceCheckEnd = 70;
            this._terraceTh = 0.1;
            this._checkTurbidityFlag = true;
            this._turbidityLevelTh = 0xfa0;
            this._checkNcFlag = true;
            this._ncTH = 10;
            this._checkRangeFlag = true;
            this._minReportTime = 7.0;
            this._checkNoiseFlag = false;
            this._noiseSD = 2;
            this._noiseLevelTh = 10;
            this._checkDetectFlag = true;
            this._detectLevelTh = 200;
            this._checkSlowReacKind = 0;
            this._srCheckWidth = 12;
            this._srWidthMaxTime = 8.0;
            this._srNCheckWidth = 12;
            this._srNWidthMinSpeed = 10.0;
            this._checkSAngleFlag = false;
            this._sangleCheckTime1 = 4.0;
            this._sangleCheckTime2 = 8.0;
            this._sangleDeltaTh = 0x30;
            this._sangleDhTh = 600;
            this._checkStartProfile = false;
            this._spCheckTime1 = 3.0;
            this._spCheckTime2 = 5.0;
            this._spCheckLimitRatio = 0.4;
            this._checkFlatCurve = false;
            this._fcCheckLimitSlope = 11.0;
            this._fcJudge_Width = 2.0;
            this._photometricTime = 360;
            this._checkDriftFlag = false;
            this._driftCheckPercent1 = 10;
            this._driftCheckPercent2 = 50;
            this._driftWidth = 8;
            this._driftRatioLimit = 200.0;
            this._checkEarlyFlag = false;
            this._earlyCheckPercent = 6;
            this._earlyPTimeTh = 15.0;
        }

        private void Set_AnaParamDef()
        {
            base.detOptWave = 4;
            base.detOptKind = 1;
            base.detOptGain = 1;
            this._refTranFlag = false;
            this._smoothFlag_Medien = true;
            this._medien_BeforeP = 2;
            this._medien_AfterP = 2;
            this._smoothFlag_ShiftAve = true;
            this._shiftAve_BeforeP = 4;
            this._shiftAve_AfterP = 0;
            this._maskTime = 5.0;
            this._bH_SearchTime = 60.0;
            this._fewCoagStartLevel = 10;
            this._fewCoagCount = 0x10;
            this._coagStartLevel = 20;
            this._coagCount = 0x10;
            this._endJudge_kind = 1;
            this._endJudge_Width = 0x40;
            this._endJudge_Height = 0x18;
            this._endJudge_Rate = 0.1;
            this._endJudge_RateCount = 0x40;
            this._endJudgeTh_Flag = false;
            this._endJudge_dH = 0x73;
            this._endJudge_dHCount = 120;
            this._coagDetCount = 0x10;
            this._coagDetPercent = 50;
            this._ChangeWave_f = false;
            this._subWave = 5;
            this.BHassume = false;
            this.BHstartS = 2.5;
            this.BHendE = 4.0;
            this.BHstartE = 95.0;
            this.BHendE = 100.0;
            this.BHStart = 2.5;
            this.BHEnd = 4.0;
            this.BHdeltaTH = 40;
            this.BHslopeTH = 0.0;
            this.BHtime = 0.0;
            this._derivativeCurve = false;
            this._derivative_Width = 60;
        }

        private void Set_DHparamDef()
        {
            this._applyCorrectDH = false;
            this._dhBase = 800;
            this._dhDis = 500;
            this._dhCor = 0.1;
            this._dhMaxtime = 0.5;
        }

        void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
        {
            if (info == null)
            {
                throw new ArgumentNullException("info in GetObjectData");
            }
            info.AddValue("AnaPerecntVersion", this.AnaPerecntVersion, typeof(string));
            info.AddValue("_refTranFlag", this._refTranFlag);
            info.AddValue("_smoothFlag_Medien", this._smoothFlag_Medien);
            info.AddValue("_medien_BeforeP", this._medien_BeforeP);
            info.AddValue("_medien_AfterP", this._medien_AfterP);
            info.AddValue("_smoothFlag_ShiftAve", this._smoothFlag_ShiftAve);
            info.AddValue("_shiftAve_BeforeP", this._shiftAve_BeforeP);
            info.AddValue("_shiftAve_AfterP", this._shiftAve_AfterP);
            info.AddValue("_maskTime", this._maskTime);
            info.AddValue("_bH_SearchTime", this._bH_SearchTime);
            info.AddValue("_fewCoagStartLevel", this._fewCoagStartLevel);
            info.AddValue("_fewCoagCount", this._fewCoagCount);
            info.AddValue("_coagStartLevel", this._coagStartLevel);
            info.AddValue("_coagCount", this._coagCount);
            info.AddValue("_endJudge_kind", this._endJudge_kind);
            info.AddValue("_endJudge_Width", this._endJudge_Width);
            info.AddValue("_endJudge_Height", this._endJudge_Height);
            info.AddValue("_endJudge_Rate", this._endJudge_Rate);
            info.AddValue("_endJudge_RateCount", this._endJudge_RateCount);
            info.AddValue("_endJudgeTh_Flag", this._endJudgeTh_Flag);
            info.AddValue("_endJudge_dH", this._endJudge_dH);
            info.AddValue("_endJudge_dHCount", this._endJudge_dHCount);
            info.AddValue("_coagDetCount", this._coagDetCount);
            info.AddValue("_coagDetPercent", this._coagDetPercent);
            info.AddValue("_ChangeWave_f", this._ChangeWave_f);
            info.AddValue("_subWave", this._subWave);
            info.AddValue("_bHAssume", this._bHAssume);
            info.AddValue("_bHstartS", this._bHstartS);
            info.AddValue("_bHendS", this._bHendS);
            info.AddValue("_bHstartE", this._bHstartE);
            info.AddValue("_bHendE", this._bHendE);
            info.AddValue("_bHStart", this._bHStart);
            info.AddValue("_bHEnd", this._bHEnd);
            info.AddValue("_bHdeltaTH", this._bHdeltaTH);
            info.AddValue("_bHslopeTh", this._bHslopeTh);
            info.AddValue("_bHtime", this._bHtime);
            info.AddValue("_derivativeCurve", this._derivativeCurve);
            info.AddValue("_derivative_Width", this._derivative_Width);
            info.AddValue("_checkTempFlag", this._checkTempFlag);
            info.AddValue("_tempValue", this._tempValue);
            info.AddValue("_checkAgedSamp", this._checkAgedSamp);
            info.AddValue("_agedMinuteTh", this._agedMinuteTh);
            info.AddValue("_checkScFlag", this._checkScFlag);
            info.AddValue("_scTH", this._scTH);
            info.AddValue("_checkNoEndFlag", this._checkNoEndFlag);
            info.AddValue("_checkIniDropKind", this._checkIniDropKind);
            info.AddValue("_iniDropCheckTime", this._iniDropCheckTime);
            info.AddValue("_iniDropDeltaTh", this._iniDropDeltaTh);
            info.AddValue("_iniDropRatioTh", this._iniDropRatioTh);
            info.AddValue("_iniDropNdeltaTh", this._iniDropNdeltaTh);
            info.AddValue("_iniDropNRateTh", this._iniDropNRateTh);
            info.AddValue("_checkSDropKind", this._checkSDropKind);
            info.AddValue("_sdropTh", this._sdropTh);
            info.AddValue("_sdropLevelTh", this._sdropLevelTh);
            info.AddValue("_checkDipFlag", this._checkDipFlag);
            info.AddValue("_dipCheckStart", this._dipCheckStart);
            info.AddValue("_dipCheckEnd", this._dipCheckEnd);
            info.AddValue("_dipPointTh", this._dipPointTh);
            info.AddValue("_checkJumpFlag", this._checkJumpFlag);
            info.AddValue("_jumpUpTh", this._jumpUpTh);
            info.AddValue("_checkStepKind", this._checkStepKind);
            info.AddValue("_stepCheckTime1", this._stepCheckTime1);
            info.AddValue("_stepCheckTime2", this._stepCheckTime2);
            info.AddValue("_stepCheckRatioTh", this._stepCheckRatioTh);
            info.AddValue("_stepCheckDiffTh", this._stepCheckDiffTh);
            info.AddValue("_stepRateTh", this._stepRateTh);
            info.AddValue("_checkFlatLaterFlag", this._checkFlatLaterFlag);
            info.AddValue("_laterSecTh", this._laterSecTh);
            info.AddValue("_laterDhTh", this._laterDhTh);
            info.AddValue("_checkTerraceFlag", this._checkTerraceFlag);
            info.AddValue("_terraceCheckStart", this._terraceCheckStart);
            info.AddValue("_terraceCheckEnd", this._terraceCheckEnd);
            info.AddValue("_terraceTh", this._terraceTh);
            info.AddValue("_checkTurbidityFlag", this._checkTurbidityFlag);
            info.AddValue("_turbidityLevelTh", this._turbidityLevelTh);
            info.AddValue("_checkNcFlag", this._checkNcFlag);
            info.AddValue("_ncTH", this._ncTH);
            info.AddValue("_checkRangeFlag", this._checkRangeFlag);
            info.AddValue("_minReportTime", this._minReportTime);
            info.AddValue("_checkNoiseFlag", this._checkNoiseFlag);
            info.AddValue("_noiseSD", this._noiseSD);
            info.AddValue("_noiseLevelTh", this._noiseLevelTh);
            info.AddValue("_checkDetectFlag", this._checkDetectFlag);
            info.AddValue("_detectLevelTh", this._detectLevelTh);
            info.AddValue("_checkSlowReacKind", this._checkSlowReacKind);
            info.AddValue("_srCheckWidth", this._srCheckWidth);
            info.AddValue("_srWidthMaxTime", this._srWidthMaxTime);
            info.AddValue("_srNCheckWidth", this._srNCheckWidth);
            info.AddValue("_srNWidthMinSpeed", this._srNWidthMinSpeed);
            info.AddValue("_checkSAngleFlag", this._checkSAngleFlag);
            info.AddValue("_sangleCheckTime1", this._sangleCheckTime1);
            info.AddValue("_sangleCheckTime2", this._sangleCheckTime2);
            info.AddValue("_sangleDeltaTh", this._sangleDeltaTh);
            info.AddValue("_sangleDhTh", this._sangleDhTh);
            info.AddValue("_checkStartProfile", this._checkStartProfile);
            info.AddValue("_spCheckTime1", this._spCheckTime1);
            info.AddValue("_spCheckTime2", this._spCheckTime2);
            info.AddValue("_spCheckLimitRatio", this._spCheckLimitRatio);
            info.AddValue("_checkFlatCurve", this._checkFlatCurve);
            info.AddValue("_fcCheckLimitSlope", this._fcCheckLimitSlope);
            info.AddValue("_fcJudge_Width", this._fcJudge_Width);
            info.AddValue("_photometricTime", this._photometricTime);
            info.AddValue("_checkDriftFlag", this._checkDriftFlag);
            info.AddValue("_driftCheckPercent1", this._driftCheckPercent1);
            info.AddValue("_driftCheckPercent2", this._driftCheckPercent2);
            info.AddValue("_driftWidth", this._driftWidth);
            info.AddValue("_driftRatioLimit", this._driftRatioLimit);
            info.AddValue("_checkEarlyFlag", this._checkEarlyFlag);
            info.AddValue("_earlyCheckPercent", this._earlyCheckPercent);
            info.AddValue("_earlyPTimeTh", this._earlyPTimeTh);
            info.AddValue("_applyCorrectDH", this._applyCorrectDH);
            info.AddValue("_dhBase", this._dhBase);
            info.AddValue("_dhDis", this._dhDis);
            info.AddValue("_dhCor", this._dhCor);
            info.AddValue("_dhMaxtime", this._dhMaxtime);
            info.AddValue("detMethod", base.DetMethod);
            info.AddValue("detOptWave", base.DetOptWave);
            info.AddValue("detOptKind", base.DetOptKind);
            info.AddValue("detOptGain", base.DetOptGain);
            info.AddValue("sampleKind", base.sampleKind);
            info.AddValue("microFlag", base.microFlag);
            info.AddValue("applyCalibReag", base.applyCalibReag);
            info.AddValue("calibReagValA", base.calibReagValA);
            info.AddValue("calibReagValB", base.calibReagValB);
            info.AddValue("applyCalibFomura0", base.applyCalibFomura0);
            info.AddValue("calibFomura0ValA", base.calibFomura0ValA);
            info.AddValue("calibFomura0ValB", base.calibFomura0ValB);
            info.AddValue("calibFomura0MicroValA", base.calibFomura0MicroValA);
            info.AddValue("calibFomura0MicroValB", base.calibFomura0MicroValB);
            info.AddValue("applyCalibFomura1", base.applyCalibFomura1);
            info.AddValue("calibFomura1ValA", base.calibFomura1ValA);
            info.AddValue("calibFomura1ValB", base.calibFomura1ValB);
            info.AddValue("AnaAlgoBase+detMethod", this.AnaAlgoBase_x002B_detMethod);
            info.AddValue("AnaAlgoBase+detOptWave", this.AnaAlgoBase_x002B_detOptWave);
            info.AddValue("AnaAlgoBase+detOptKind", this.AnaAlgoBase_x002B_detOptKind);
            info.AddValue("AnaAlgoBase+detOptGain", this.AnaAlgoBase_x002B_detOptGain);
            info.AddValue("AnaAlgoBase+sampleKind", this.AnaAlgoBase_x002B_sampleKind);
            info.AddValue("AnaAlgoBase+microFlag", this.AnaAlgoBase_x002B_microFlag);
            info.AddValue("AnaAlgoBase+applyCalibReag", this.AnaAlgoBase_x002B_applyCalibReag);
            info.AddValue("AnaAlgoBase+calibReagValA", this.AnaAlgoBase_x002B_calibReagValA);
            info.AddValue("AnaAlgoBase+calibReagValB", this.AnaAlgoBase_x002B_calibReagValB);
            info.AddValue("AnaAlgoBase+applyCalibFomura0", this.AnaAlgoBase_x002B_applyCalibFomura0);
            info.AddValue("AnaAlgoBase+calibFomura0ValA", this.AnaAlgoBase_x002B_calibFomura0ValA);
            info.AddValue("AnaAlgoBase+calibFomura0ValB", this.AnaAlgoBase_x002B_calibFomura0ValB);
            info.AddValue("AnaAlgoBase+calibFomura0MicroValA", this.AnaAlgoBase_x002B_calibFomura0MicroValA);
            info.AddValue("AnaAlgoBase+calibFomura0MicroValB", this.AnaAlgoBase_x002B_calibFomura0MicroValB);
            info.AddValue("AnaAlgoBase+applyCalibFomura1", this.AnaAlgoBase_x002B_applyCalibFomura1);
            info.AddValue("AnaAlgoBase+calibFomura1ValA", this.AnaAlgoBase_x002B_calibFomura1ValA);
            info.AddValue("AnaAlgoBase+calibFomura1ValB", this.AnaAlgoBase_x002B_calibFomura1ValB);
        }

        public int AgedMinute_th
        {
            get
            {
                return this._agedMinuteTh;
            }
            set
            {
                this._agedMinuteTh = value;
            }
        }

        public string AnaVersion
        {
            get
            {
                return this.AnaPerecntVersion;
            }
        }

        public bool ApplyCorrectDH
        {
            get
            {
                return this._applyCorrectDH;
            }
            set
            {
                this._applyCorrectDH = value;
            }
        }

        public double bH_SearchTime
        {
            get
            {
                return this._bH_SearchTime;
            }
            set
            {
                this._bH_SearchTime = value;
            }
        }

        public bool BHassume
        {
            get
            {
                return this._bHAssume;
            }
            set
            {
                this._bHAssume = value;
            }
        }

        public int BHdeltaTH
        {
            get
            {
                return this._bHdeltaTH;
            }
            set
            {
                this._bHdeltaTH = value;
            }
        }

        public double BHEnd
        {
            get
            {
                return this._bHEnd;
            }
            set
            {
                this._bHEnd = value;
            }
        }

        public double BHendE
        {
            get
            {
                return this._bHendE;
            }
            set
            {
                this._bHendE = value;
            }
        }

        public double BHendS
        {
            get
            {
                return this._bHendS;
            }
            set
            {
                this._bHendS = value;
            }
        }

        public double BHslopeTH
        {
            get
            {
                return this._bHslopeTh;
            }
            set
            {
                this._bHslopeTh = value;
            }
        }

        public double BHStart
        {
            get
            {
                return this._bHStart;
            }
            set
            {
                this._bHStart = value;
            }
        }

        public double BHstartE
        {
            get
            {
                return this._bHstartE;
            }
            set
            {
                this._bHstartE = value;
            }
        }

        public double BHstartS
        {
            get
            {
                return this._bHstartS;
            }
            set
            {
                this._bHstartS = value;
            }
        }

        public double BHtime
        {
            get
            {
                return this._bHtime;
            }
            set
            {
                this._bHtime = value;
            }
        }

        public bool ChangeWave_f
        {
            get
            {
                return this._ChangeWave_f;
            }
            set
            {
                this._ChangeWave_f = value;
            }
        }

        public bool CheckAgedSamp_flag
        {
            get
            {
                return this._checkAgedSamp;
            }
            set
            {
                this._checkAgedSamp = value;
            }
        }

        public bool CheckDetect_flag
        {
            get
            {
                return this._checkDetectFlag;
            }
            set
            {
                this._checkDetectFlag = value;
            }
        }

        public bool CheckDip_flag
        {
            get
            {
                return this._checkDipFlag;
            }
            set
            {
                this._checkDipFlag = value;
            }
        }

        public bool CheckDrift_flag
        {
            get
            {
                return this._checkDriftFlag;
            }
            set
            {
                this._checkDriftFlag = value;
            }
        }

        public bool CheckEarly_falg
        {
            get
            {
                return this._checkEarlyFlag;
            }
            set
            {
                this._checkEarlyFlag = value;
            }
        }

        public bool CheckFlatCurve
        {
            get
            {
                return this._checkFlatCurve;
            }
            set
            {
                this._checkFlatCurve = value;
            }
        }

        public bool CheckFlatLater_flag
        {
            get
            {
                return this._checkFlatLaterFlag;
            }
            set
            {
                this._checkFlatLaterFlag = value;
            }
        }

        public int CheckIniDrop_kind
        {
            get
            {
                return this._checkIniDropKind;
            }
            set
            {
                this._checkIniDropKind = value;
            }
        }

        public bool CheckJump_flag
        {
            get
            {
                return this._checkJumpFlag;
            }
            set
            {
                this._checkJumpFlag = value;
            }
        }

        public bool CheckNC_flag
        {
            get
            {
                return this._checkNcFlag;
            }
            set
            {
                this._checkNcFlag = value;
            }
        }

        public bool CheckNoEnd_flag
        {
            get
            {
                return this._checkNoEndFlag;
            }
            set
            {
                this._checkNoEndFlag = value;
            }
        }

        public bool CheckNoise_flag
        {
            get
            {
                return this._checkNoiseFlag;
            }
            set
            {
                this._checkNoiseFlag = value;
            }
        }

        public bool CheckRange_flag
        {
            get
            {
                return this._checkRangeFlag;
            }
            set
            {
                this._checkRangeFlag = value;
            }
        }

        public bool CheckSAngle_flag
        {
            get
            {
                return this._checkSAngleFlag;
            }
            set
            {
                this._checkSAngleFlag = value;
            }
        }

        public bool CheckSC_flag
        {
            get
            {
                return this._checkScFlag;
            }
            set
            {
                this._checkScFlag = value;
            }
        }

        public int CheckSDrop_kind
        {
            get
            {
                return this._checkSDropKind;
            }
            set
            {
                this._checkSDropKind = value;
            }
        }

        public int CheckSlowReac_kind
        {
            get
            {
                return this._checkSlowReacKind;
            }
            set
            {
                this._checkSlowReacKind = value;
            }
        }

        public bool CheckStartProfile
        {
            get
            {
                return this._checkStartProfile;
            }
            set
            {
                this._checkStartProfile = value;
            }
        }

        public int CheckStep_kind
        {
            get
            {
                return this._checkStepKind;
            }
            set
            {
                this._checkStepKind = value;
            }
        }

        public bool CheckTemp_flag
        {
            get
            {
                return this._checkTempFlag;
            }
            set
            {
                this._checkTempFlag = value;
            }
        }

        public bool CheckTerrace_flag
        {
            get
            {
                return this._checkTerraceFlag;
            }
            set
            {
                this._checkTerraceFlag = value;
            }
        }

        public bool CheckTurbidity_flag
        {
            get
            {
                return this._checkTurbidityFlag;
            }
            set
            {
                this._checkTurbidityFlag = value;
            }
        }

        public int CoagCount
        {
            get
            {
                return this._coagCount;
            }
            set
            {
                this._coagCount = value;
            }
        }

        public int CoagDetCount
        {
            get
            {
                return this._coagDetCount;
            }
            set
            {
                this._coagDetCount = value;
            }
        }

        public int CoagDetPercent
        {
            get
            {
                return this._coagDetPercent;
            }
            set
            {
                this._coagDetPercent = value;
            }
        }

        public int CoagStartLevel
        {
            get
            {
                return this._coagStartLevel;
            }
            set
            {
                this._coagStartLevel = value;
            }
        }

        public int Derivative_Width
        {
            get
            {
                return this._derivative_Width;
            }
            set
            {
                this._derivative_Width = value;
            }
        }

        public bool DerivativeCurve
        {
            get
            {
                return this._derivativeCurve;
            }
            set
            {
                this._derivativeCurve = value;
            }
        }

        public int DetectLevel_th
        {
            get
            {
                return this._detectLevelTh;
            }
            set
            {
                this._detectLevelTh = value;
            }
        }

        public int DH_BASE
        {
            get
            {
                return this._dhBase;
            }
            set
            {
                this._dhBase = value;
            }
        }

        public double DH_COR
        {
            get
            {
                return this._dhCor;
            }
            set
            {
                this._dhCor = value;
            }
        }

        public int DH_DIS
        {
            get
            {
                return this._dhDis;
            }
            set
            {
                this._dhDis = value;
            }
        }

        public double DH_MAXTIME
        {
            get
            {
                return this._dhMaxtime;
            }
            set
            {
                this._dhMaxtime = value;
            }
        }

        public int DipCheckEnd
        {
            get
            {
                return this._dipCheckEnd;
            }
            set
            {
                this._dipCheckEnd = value;
            }
        }

        public int DipCheckStart
        {
            get
            {
                return this._dipCheckStart;
            }
            set
            {
                this._dipCheckStart = value;
            }
        }

        public int DipPoint_th
        {
            get
            {
                return this._dipPointTh;
            }
            set
            {
                this._dipPointTh = value;
            }
        }

        public int DriftCheckPercent1
        {
            get
            {
                return this._driftCheckPercent1;
            }
            set
            {
                this._driftCheckPercent1 = value;
            }
        }

        public int DriftCheckPercent2
        {
            get
            {
                return this._driftCheckPercent2;
            }
            set
            {
                this._driftCheckPercent2 = value;
            }
        }

        public double DriftRatio_limit
        {
            get
            {
                return this._driftRatioLimit;
            }
            set
            {
                this._driftRatioLimit = value;
            }
        }

        public int DriftWidth
        {
            get
            {
                return this._driftWidth;
            }
            set
            {
                this._driftWidth = value;
            }
        }

        public int EarlyCheckPercent
        {
            get
            {
                return this._earlyCheckPercent;
            }
            set
            {
                this._earlyCheckPercent = value;
            }
        }

        public double EarlyPtime_th
        {
            get
            {
                return this._earlyPTimeTh;
            }
            set
            {
                this._earlyPTimeTh = value;
            }
        }

        public int EndJudge_dH
        {
            get
            {
                return this._endJudge_dH;
            }
            set
            {
                this._endJudge_dH = value;
            }
        }

        public int EndJudge_dHCount
        {
            get
            {
                return this._endJudge_dHCount;
            }
            set
            {
                this._endJudge_dHCount = value;
            }
        }

        public int EndJudge_Kind
        {
            get
            {
                return this._endJudge_kind;
            }
            set
            {
                this._endJudge_kind = value;
            }
        }

        public int EndJudge1_Height
        {
            get
            {
                return this._endJudge_Height;
            }
            set
            {
                this._endJudge_Height = value;
            }
        }

        public int EndJudge1_Width
        {
            get
            {
                return this._endJudge_Width;
            }
            set
            {
                this._endJudge_Width = value;
            }
        }

        public double EndJudge2_Rate
        {
            get
            {
                return this._endJudge_Rate;
            }
            set
            {
                this._endJudge_Rate = value;
            }
        }

        public int EndJudge2_RateCount
        {
            get
            {
                return this._endJudge_RateCount;
            }
            set
            {
                this._endJudge_RateCount = value;
            }
        }

        public bool EndJudgeTh_Flag
        {
            get
            {
                return this._endJudgeTh_Flag;
            }
            set
            {
                this._endJudgeTh_Flag = value;
            }
        }

        public double FCcheckLimitSlope
        {
            get
            {
                return this._fcCheckLimitSlope;
            }
            set
            {
                this._fcCheckLimitSlope = value;
            }
        }

        public double FCjudge_Width
        {
            get
            {
                return this._fcJudge_Width;
            }
            set
            {
                this._fcJudge_Width = value;
            }
        }

        public int FewCoagCount
        {
            get
            {
                return this._fewCoagCount;
            }
            set
            {
                this._fewCoagCount = value;
            }
        }

        public int FewCoagStartLevel
        {
            get
            {
                return this._fewCoagStartLevel;
            }
            set
            {
                this._fewCoagStartLevel = value;
            }
        }

        public double IniDropCheck_time
        {
            get
            {
                return this._iniDropCheckTime;
            }
            set
            {
                this._iniDropCheckTime = value;
            }
        }

        public int IniDropDelta_th
        {
            get
            {
                return this._iniDropDeltaTh;
            }
            set
            {
                this._iniDropDeltaTh = value;
            }
        }

        public int IniDropNDelta_th
        {
            get
            {
                return this._iniDropNdeltaTh;
            }
            set
            {
                this._iniDropNdeltaTh = value;
            }
        }

        public double IniDropNRate_th
        {
            get
            {
                return this._iniDropNRateTh;
            }
            set
            {
                this._iniDropNRateTh = value;
            }
        }

        public double IniDropRatio_th
        {
            get
            {
                return this._iniDropRatioTh;
            }
            set
            {
                this._iniDropRatioTh = value;
            }
        }

        public int JumpUp_th
        {
            get
            {
                return this._jumpUpTh;
            }
            set
            {
                this._jumpUpTh = value;
            }
        }

        public int LaterDh_th
        {
            get
            {
                return this._laterDhTh;
            }
            set
            {
                this._laterDhTh = value;
            }
        }

        public double LaterSec_th
        {
            get
            {
                return this._laterSecTh;
            }
            set
            {
                this._laterSecTh = value;
            }
        }

        public double MaskTime
        {
            get
            {
                return this._maskTime;
            }
            set
            {
                this._maskTime = value;
            }
        }

        public int Medien_AfterP
        {
            get
            {
                return this._medien_AfterP;
            }
            set
            {
                this._medien_AfterP = value;
            }
        }

        public int Medien_BeforeP
        {
            get
            {
                return this._medien_BeforeP;
            }
            set
            {
                this._medien_BeforeP = value;
            }
        }

        public double MinReport_time
        {
            get
            {
                return this._minReportTime;
            }
            set
            {
                this._minReportTime = value;
            }
        }

        public int NC_th
        {
            get
            {
                return this._ncTH;
            }
            set
            {
                this._ncTH = value;
            }
        }

        public int NoiseLvel_th
        {
            get
            {
                return this._noiseLevelTh;
            }
            set
            {
                this._noiseLevelTh = value;
            }
        }

        public int NoiseSD
        {
            get
            {
                return this._noiseSD;
            }
            set
            {
                this._noiseSD = value;
            }
        }

        public int PhotometricTime
        {
            get
            {
                return this._photometricTime;
            }
            set
            {
                this._photometricTime = value;
            }
        }

        public bool RefTranFlag
        {
            get
            {
                return this._refTranFlag;
            }
            set
            {
                this._refTranFlag = value;
            }
        }

        public double SAngleCheck_time1
        {
            get
            {
                return this._sangleCheckTime1;
            }
            set
            {
                this._sangleCheckTime1 = value;
            }
        }

        public double SAngleCheck_time2
        {
            get
            {
                return this._sangleCheckTime2;
            }
            set
            {
                this._sangleCheckTime2 = value;
            }
        }

        public int SAngleDelta_th
        {
            get
            {
                return this._sangleDeltaTh;
            }
            set
            {
                this._sangleDeltaTh = value;
            }
        }

        public int SAngleDH_th
        {
            get
            {
                return this._sangleDhTh;
            }
            set
            {
                this._sangleDhTh = value;
            }
        }

        public int SC_th
        {
            get
            {
                return this._scTH;
            }
            set
            {
                this._scTH = value;
            }
        }

        public int SDrop_th
        {
            get
            {
                return this._sdropTh;
            }
            set
            {
                this._sdropTh = value;
            }
        }

        public double SDropLevel_th
        {
            get
            {
                return this._sdropLevelTh;
            }
            set
            {
                this._sdropLevelTh = value;
            }
        }

        public int ShiftAve_AfterP
        {
            get
            {
                return this._shiftAve_AfterP;
            }
            set
            {
                this._shiftAve_AfterP = value;
            }
        }

        public int ShiftAve_BeforeP
        {
            get
            {
                return this._shiftAve_BeforeP;
            }
            set
            {
                this._shiftAve_BeforeP = value;
            }
        }

        public bool SmoothFlag_Medien
        {
            get
            {
                return this._smoothFlag_Medien;
            }
            set
            {
                this._smoothFlag_Medien = value;
            }
        }

        public bool SmoothFlag_ShiftAve
        {
            get
            {
                return this._smoothFlag_ShiftAve;
            }
            set
            {
                this._smoothFlag_ShiftAve = value;
            }
        }

        public double SPcheckLimitRatio
        {
            get
            {
                return this._spCheckLimitRatio;
            }
            set
            {
                this._spCheckLimitRatio = value;
            }
        }

        public double SPcheckTime1
        {
            get
            {
                return this._spCheckTime1;
            }
            set
            {
                this._spCheckTime1 = value;
            }
        }

        public double SPcheckTime2
        {
            get
            {
                return this._spCheckTime2;
            }
            set
            {
                this._spCheckTime2 = value;
            }
        }

        public double SR2Ratio
        {
            get
            {
                return this._srNWidthMinSpeed;
            }
            set
            {
                this._srNWidthMinSpeed = value;
            }
        }

        public int SRcheckWidth
        {
            get
            {
                return this._srCheckWidth;
            }
            set
            {
                this._srCheckWidth = value;
            }
        }

        public int SRNcheckWidth
        {
            get
            {
                return this._srNCheckWidth;
            }
            set
            {
                this._srNCheckWidth = value;
            }
        }

        public double SRwidthMaxTime
        {
            get
            {
                return this._srWidthMaxTime;
            }
            set
            {
                this._srWidthMaxTime = value;
            }
        }

        public double StepCheck_time1
        {
            get
            {
                return this._stepCheckTime1;
            }
            set
            {
                this._stepCheckTime1 = value;
            }
        }

        public double StepCheck_time2
        {
            get
            {
                return this._stepCheckTime2;
            }
            set
            {
                this._stepCheckTime2 = value;
            }
        }

        public int StepCheckDiff_th
        {
            get
            {
                return this._stepCheckDiffTh;
            }
            set
            {
                this._stepCheckDiffTh = value;
            }
        }

        public double StepCheckRatio_th
        {
            get
            {
                return this._stepCheckRatioTh;
            }
            set
            {
                this._stepCheckRatioTh = value;
            }
        }

        public double StepRate_th
        {
            get
            {
                return this._stepRateTh;
            }
            set
            {
                this._stepRateTh = value;
            }
        }

        public uint SubWave
        {
            get
            {
                return this._subWave;
            }
            set
            {
                this._subWave = value;
            }
        }

        public int TempValue
        {
            get
            {
                return this._tempValue;
            }
            set
            {
                this._tempValue = value;
            }
        }

        public double Terrace_th
        {
            get
            {
                return this._terraceTh;
            }
            set
            {
                this._terraceTh = value;
            }
        }

        public int TerraceCheckEnd
        {
            get
            {
                return this._terraceCheckEnd;
            }
            set
            {
                this._terraceCheckEnd = value;
            }
        }

        public int TerraceCheckStart
        {
            get
            {
                return this._terraceCheckStart;
            }
            set
            {
                this._terraceCheckStart = value;
            }
        }

        public int TurbidityLevel_th
        {
            get
            {
                return this._turbidityLevelTh;
            }
            set
            {
                this._turbidityLevelTh = value;
            }
        }

        private class AnaWorkPercent : AnaWorkBase
        {
            private int[] ana_data;
            private int[] ana_data_realTime;
            private ArrayList analyzeInfoList;
            private double[] anaOptDataDeriv1;
            private double[] anaOptDataDeriv2;
            private double[] anaOptDataRel;
            private double[] anaOptDataRelSmooth;
            private ushort[] anaOptDataWrk;
            private int coag_p;
            private bool coag_search_f;
            private double coagPointSlope;
            private ArrayList coagTimeFlag;
            private ArrayList deltaHFlag;
            private const uint DetChannelTmep_ERR = 1;
            private int dH;
            private int flat_p;
            private bool flat_search_f;
            private const uint Instrument_ERR = 1;
            private AnaMathTool math_tool;
            private int max;
            private int max_p;
            private double max2;
            private int max2_p;
            private int min;
            private int min_p;
            private double min1;
            private int min1_p;
            private double min2;
            private int min2_p;
            private const uint NO_ERR = 0;
            private AnaAlgoPercent prm;
            private IRawData raw;
            private AnaResult res;
            private ushort[] reverce_ad;
            private bool reverce_f = false;
            private ArrayList sampleInfoList;
            private double t_para;
            private int t_para_rate;
            private bool waveChange_f;
            private bool[] wrkJudgeHeight;

            public void AddCoagTimeFlag(object flag)
            {
                if (!this.coagTimeFlag.Contains(flag))
                {
                    this.coagTimeFlag.Add(flag);
                }
            }

            public void AddDeltaHFlag(object flag)
            {
                if (!this.deltaHFlag.Contains(flag))
                {
                    this.deltaHFlag.Add(flag);
                }
            }

            public IAnaResult Analyze(AnaAlgoPercent prm, IRawData rd)
            {
                this.prm = prm;
                this.raw = rd;
                uint detOptWave = this.prm.DetOptWave;
                if (this.prm.ChangeWave_f)
                {
                    detOptWave = this.AnaWave();
                }
                this.Set_AnaWorkParamDef();
                this.SetInfoAnaResult();
                if ((this.raw.ErrorInfo != 0) || this.res.CheckBlankAD(this.raw))
                {
                    this.SetAnaRestultERR(1);
                }
                else
                {
                    base.anaOptDataOrg = this.raw.GetOptData(detOptWave, this.prm.detOptKind, this.prm.detOptGain);
                    if ((base.anaOptDataOrg == null) || (base.anaOptDataOrg.Length <= 0))
                    {
                        this.SetAnaRestultERR(1);
                    }
                    else
                    {
                        base.anaOptData = this.raw.GetOptData(detOptWave, this.prm.detOptKind, this.prm.detOptGain);
                        if (this.prm.RefTranFlag)
                        {
                            uint detOptKind = 0;
                            switch (this.prm.detOptKind)
                            {
                                case 1:
                                    detOptKind = 2;
                                    break;

                                case 2:
                                    detOptKind = 1;
                                    break;
                            }
                            ushort[] refData = this.raw.GetOptData(detOptWave, detOptKind, this.prm.detOptGain);
                            base.anaOptData = this.prm.GetRefTranAD(base.anaOptData, refData);
                        }
                        if (this.prm.SmoothFlag_Medien)
                        {
                            base.anaOptData = this.prm.GetMedienSmoothOptData(base.anaOptData, this.prm.Medien_BeforeP, this.prm.Medien_AfterP);
                        }
                        if (this.prm.SmoothFlag_ShiftAve)
                        {
                            base.anaOptData = this.prm.GetShiftAveSmoothOptData(base.anaOptData, this.prm.ShiftAve_BeforeP, this.prm.ShiftAve_AfterP);
                            if (this.prm.CheckStep_kind == 2)
                            {
                                this.anaOptDataWrk = new ushort[base.anaOptData.Length];
                                Array.Copy(base.anaOptData, this.anaOptDataWrk, base.anaOptData.Length);
                                this.CheckFlat_JudgeHight();
                            }
                        }
                        if (this.prm.DetOptKind == 1)
                        {
                            this.reverce_ad = base.anaOptData;
                            base.anaOptData = this.prm.GetReverseOptData(base.anaOptData);
                            this.reverce_f = true;
                        }
                        if (this.prm.ChangeWave_f && (detOptWave == this.prm.SubWave))
                        {
                            this.analyzeInfoList.Add("Ana_Wave=" + this.GetWaveString(detOptWave).ToString());
                            this.waveChange_f = true;
                            this.res.DetOptWave = detOptWave;
                        }
                        this.CreatCoagData();
                        if (this.MakeAnalysisData() && this.prm.CheckDip_flag)
                        {
                            this.res.AddError(330);
                        }
                        this.CheckCurve();
                        this.SetAnaResult();
                        if (this.prm.DerivativeCurve)
                        {
                            this.MakeDerivativeAnalysis();
                        }
                    }
                }
                this.SetAnaRestultErrPriority();
                return this.res;
            }

            private uint AnaWave()
            {
                uint detOptWave = this.prm.DetOptWave;
                uint[] numArray = new uint[] { this.prm.DetOptWave, this.prm.SubWave };
                uint detOptKind = this.prm.DetOptKind;
                uint detOptGain = this.prm.DetOptGain;
                int dH = 0;
                for (int i = 0; i < numArray.Length; i++)
                {
                    this.Set_AnaWorkParamDef();
                    if (this.DataSmooth(numArray[i], detOptKind, detOptGain))
                    {
                        this.CreatCoagData();
                        if (!this.CheckLow() && !this.CheckHigh())
                        {
                            if (this.dH >= this.prm.SC_th)
                            {
                                return numArray[i];
                            }
                            if ((this.dH >= this.prm.NC_th) && (this.dH > dH))
                            {
                                dH = this.dH;
                                detOptWave = numArray[i];
                            }
                        }
                    }
                }
                return detOptWave;
            }

            private double Calc_dOD()
            {
                double num = 0.0;
                ushort num2 = (ushort) (0xfff - base.anaOptData[this.min_p]);
                ushort num3 = (ushort) (0xfff - base.anaOptData[this.flat_p]);
                if (num2 != 0)
                {
                    num = Math.Log10(((double) num2) / ((double) num3));
                }
                return num;
            }

            private bool Check_chkP(int P)
            {
                bool flag = true;
                if (P >= 100)
                {
                    return false;
                }
                if (P < 0)
                {
                    flag = false;
                }
                return flag;
            }

            private void Check_EarlyReaction()
            {
                bool flag = false;
                flag = this.CheckSpeedChangeDetection();
                if ((this.prm.CheckSlowReac_kind != 0) && this.CheckSlowReaction())
                {
                    if (this.prm.CheckSlowReac_kind == 2)
                    {
                        if (flag)
                        {
                            this.res.AddError(910);
                        }
                    }
                    else
                    {
                        this.res.AddError(910);
                    }
                }
                if (this.prm.CheckSAngle_flag)
                {
                    switch (this.CheckStartAngle())
                    {
                        case 1:
                            this.res.AddError(920);
                            break;

                        case 2:
                            this.res.AddError(930);
                            break;
                    }
                }
                if (this.prm.CheckStartProfile && this.CheckStartProfilePROC())
                {
                    this.res.AddError(920);
                }
                if (this.prm.CheckDrift_flag && this.CheckDrift())
                {
                    this.res.AddError(940);
                }
                if (this.prm.CheckEarly_falg && this.CheckEarlyPercent())
                {
                    this.res.AddError(950);
                }
            }

            private void CheckCurve()
            {
                if ((this.prm.CheckSC_flag && (this.dH < this.prm.SC_th)) && (this.dH >= this.prm.NC_th))
                {
                    this.res.AddError(100);
                }
                if (this.prm.CheckNC_flag && (this.dH < this.prm.NC_th))
                {
                    this.res.AddError(500);
                }
                if (this.CheckLow())
                {
                    this.res.AddError(800);
                }
                if (this.CheckHigh())
                {
                    this.res.AddError(400);
                }
                if (this.CheckInitialFluctuationDrop())
                {
                    this.res.AddError(310);
                }
                if ((this.prm.CheckSDrop_kind != 0) && this.CheckSharpDrop())
                {
                    this.res.AddError(320);
                }
                if (this.prm.CheckFlatLater_flag)
                {
                    int num = (int) (this.prm.LaterSec_th * this.t_para_rate);
                    if ((this.dH > this.prm.LaterDh_th) && (this.flat_p > num))
                    {
                        this.res.AddError(360);
                    }
                }
                if (this.prm.CheckRange_flag)
                {
                    int num2 = (int) (this.prm.MinReport_time * this.t_para_rate);
                    if (this.ana_data[this.prm.CoagDetPercent - 1] < num2)
                    {
                        this.res.AddError(600);
                    }
                }
                if (this.prm.CheckNoise_flag && this.CheckNoise())
                {
                    this.res.AddError(700);
                }
                if (this.prm.CheckJump_flag && this.CheckJumpUp())
                {
                    this.res.AddError(340);
                }
                uint detOptWave = 5;
                uint detOptKind = 1;
                uint detOptGain = 1;
                ushort[] rawData = this.raw.GetOptData(detOptWave, detOptKind, detOptGain);
                int startIndex = ((int) (this.prm.MaskTime * this.t_para_rate)) + 1;
                int endIndex = this.flat_p;
                double bHslopeTH = this.prm.BHslopeTH;
                if (this.prm.BHslopeTH == 0.0)
                {
                    bHslopeTH = 0.1;
                }
                double jumpTH = this.dH * bHslopeTH;
                if (this.prm.JumpError(rawData, startIndex, endIndex, jumpTH) && (this.dH >= this.prm.NC_th))
                {
                    this.res.AddError(340);
                }
                if (this.prm.CheckTerrace_flag && this.CheckTerrace())
                {
                    this.res.AddError(370);
                }
                this.Check_EarlyReaction();
                if (this.prm.CheckFlatCurve)
                {
                    bool flag2;
                    bool flag = this.CheckFlatCurvePROC();
                    if ((base.anaOptData.Length + 100) < (this.prm.PhotometricTime * this.t_para_rate))
                    {
                        flag2 = true;
                    }
                    else
                    {
                        flag2 = false;
                    }
                    if (flag)
                    {
                        if (!flag2)
                        {
                            this.res.AddError(520);
                        }
                        else if (flag2)
                        {
                            this.res.AddError(510);
                        }
                    }
                }
            }

            private bool CheckDrift()
            {
                bool flag = false;
                int num = this.prm.DriftWidth / 2;
                int num2 = this.prm.DriftCheckPercent1 - num;
                int num3 = this.prm.DriftCheckPercent1 + num;
                int num4 = this.prm.DriftCheckPercent2 - num;
                int num5 = this.prm.DriftCheckPercent2 + num;
                if (((this.Check_chkP(num2 - 1) && this.Check_chkP(num3 - 1)) && this.Check_chkP(num4 - 1)) && this.Check_chkP(num5 - 1))
                {
                    double num6 = this.ana_data[num3 - 1] - this.ana_data[num2 - 1];
                    double num7 = this.ana_data[num5 - 1] - this.ana_data[num4 - 1];
                    if ((num6 * 100.0) < (num7 * this.prm.DriftRatio_limit))
                    {
                        flag = true;
                    }
                }
                return flag;
            }

            private bool CheckEarlyPercent()
            {
                bool flag = false;
                if (this.Check_chkP(this.prm.EarlyCheckPercent))
                {
                    int num = this.ana_data[this.prm.EarlyCheckPercent - 1];
                    if (num < ((int) (this.prm.EarlyPtime_th * this.t_para_rate)))
                    {
                        flag = true;
                    }
                }
                return flag;
            }

            private void CheckFlat_JudgeHight()
            {
                this.wrkJudgeHeight = new bool[this.anaOptDataWrk.Length];
                int index = 0x12 + this.prm.EndJudge1_Width;
                for (int i = 0; i < index; i++)
                {
                    this.wrkJudgeHeight[i] = false;
                }
                double num7 = this.prm.EndJudge1_Height;
                while (index < (this.anaOptDataWrk.Length - this.prm.EndJudge1_Width))
                {
                    int num = index - this.prm.EndJudge1_Width;
                    int num3 = index + this.prm.EndJudge1_Width;
                    double num5 = this.anaOptDataWrk[index] - this.anaOptDataWrk[num3];
                    double num6 = this.anaOptDataWrk[num] - this.anaOptDataWrk[index];
                    if (num6 < num7)
                    {
                        num6 = num7;
                    }
                    if (num5 < num7)
                    {
                        num5 = num7;
                    }
                    if ((num5 / num6) >= this.prm.StepRate_th)
                    {
                        this.wrkJudgeHeight[num3] = true;
                    }
                    index++;
                }
            }

            private bool CheckFlatCurvePROC()
            {
                bool flag = false;
                double slope = 0.0;
                this.coagPointSlope = -1.0;
                int num3 = this.ana_data_realTime[this.prm.CoagDetPercent - 1];
                int num4 = (int) ((this.prm.FCjudge_Width * 10.0) / 2.0);
                int start = num3 - num4;
                int end = num3 + num4;
                if (end > (base.anaOptData.Length - 1))
                {
                    end = base.anaOptData.Length - 1;
                }
                if (start > 0)
                {
                    if (this.math_tool.CalSlope(start, end, base.anaOptData, this.t_para, ref slope))
                    {
                        return flag;
                    }
                    if (slope < 0.0)
                    {
                        slope = 0.0;
                    }
                    int num2 = (int) ((slope * 100.0) + 0.5);
                    this.coagPointSlope = ((double) num2) / 100.0;
                    if (this.coagPointSlope <= this.prm.FCcheckLimitSlope)
                    {
                        flag = true;
                    }
                }
                return flag;
            }

            private bool CheckHigh()
            {
                int num2;
                bool flag = false;
                int num = ((int) (this.prm.MaskTime * this.t_para_rate)) + 1;
                if (this.reverce_f)
                {
                    if (this.prm.CheckTurbidity_flag)
                    {
                        for (num2 = num; num2 < this.reverce_ad.Length; num2++)
                        {
                            if (this.reverce_ad[num2] <= this.prm.DetectLevel_th)
                            {
                                return true;
                            }
                        }
                    }
                    return flag;
                }
                if (this.prm.CheckTurbidity_flag)
                {
                    for (num2 = num; num2 < base.anaOptData.Length; num2++)
                    {
                        if (base.anaOptData[num2] >= this.prm.TurbidityLevel_th)
                        {
                            return true;
                        }
                    }
                }
                return flag;
            }

            private bool CheckInitialFluctuationDrop()
            {
                bool flag = false;
                switch (this.prm.CheckIniDrop_kind)
                {
                    case 1:
                    {
                        int index = (int) (this.prm.IniDropCheck_time * this.t_para_rate);
                        if (index < base.anaOptData.Length)
                        {
                            int num2 = base.anaOptData[index] - this.min;
                            if ((num2 > this.prm.IniDropDelta_th) && (num2 > (this.dH * this.prm.IniDropRatio_th)))
                            {
                                flag = true;
                            }
                        }
                        return flag;
                    }
                    case 2:
                    {
                        int start = ((int) (this.prm.MaskTime * this.t_para_rate)) + 1;
                        if (start < base.anaOptData.Length)
                        {
                            int num5 = this.math_tool.MaxValue(base.anaOptData, start, this.min_p) - this.min;
                            if ((num5 > this.prm.IniDropNDelta_th) && (num5 > (this.prm.IniDropNRate_th * this.dH)))
                            {
                                flag = true;
                            }
                        }
                        return flag;
                    }
                }
                return flag;
            }

            private bool CheckJumpUp()
            {
                int num = 0;
                double num2 = this.ana_data[0];
                for (int i = 1; i < this.ana_data.Length; i++)
                {
                    if (num2 == this.ana_data[i])
                    {
                        num++;
                    }
                    else
                    {
                        num = 0;
                        num2 = this.ana_data[i];
                    }
                    if (num >= this.prm.JumpUp_th)
                    {
                        return true;
                    }
                }
                return false;
            }

            private bool CheckLow()
            {
                int num2;
                bool flag = false;
                int num = ((int) (this.prm.MaskTime * this.t_para_rate)) + 1;
                if (this.reverce_f)
                {
                    if (this.prm.CheckDetect_flag)
                    {
                        for (num2 = num; num2 < this.reverce_ad.Length; num2++)
                        {
                            if (this.reverce_ad[num2] >= this.prm.TurbidityLevel_th)
                            {
                                return true;
                            }
                        }
                    }
                    return flag;
                }
                if (this.prm.CheckDetect_flag)
                {
                    for (num2 = num; num2 < base.anaOptData.Length; num2++)
                    {
                        if (base.anaOptData[num2] <= this.prm.DetectLevel_th)
                        {
                            return true;
                        }
                    }
                }
                return flag;
            }

            private bool CheckNoise()
            {
                bool flag = false;
                double aVE = 0.0;
                double num2 = 0.0;
                double sD = 0.0;
                double num4 = 0.0;
                int start = ((int) (this.prm.MaskTime * this.t_para_rate)) + 1;
                this.math_tool.CalSDandAVE(base.anaOptData, start, this.min_p, ref sD, ref aVE);
                this.math_tool.CalSDandAVE(base.anaOptData, this.flat_p, base.anaOptData.Length - 1, ref num4, ref num2);
                double num6 = aVE + (this.prm.NoiseSD * sD);
                double num7 = num2 - (this.prm.NoiseSD * num4);
                if ((num7 - num6) < this.prm.NoiseLvel_th)
                {
                    flag = true;
                }
                return flag;
            }

            private bool CheckSharpDrop()
            {
                int num;
                int num3;
                bool flag = false;
                int num2 = 0;
                switch (this.prm.CheckSDrop_kind)
                {
                    case 1:
                        num = 0;
                        num2 = 0;
                        for (num3 = this.min_p; num3 <= this.flat_p; num3++)
                        {
                            num2 = num - base.anaOptData[num3];
                            if (num < base.anaOptData[num3])
                            {
                                num = base.anaOptData[num3];
                            }
                            else if (num2 > this.prm.SDrop_th)
                            {
                                return true;
                            }
                        }
                        return flag;

                    case 2:
                        num = 0;
                        num2 = 0;
                        for (num3 = this.min_p; num3 < base.anaOptData.Length; num3++)
                        {
                            num2 = num - base.anaOptData[num3];
                            if (num < base.anaOptData[num3])
                            {
                                num = base.anaOptData[num3];
                            }
                            else if (num2 >= (this.prm.SDropLevel_th * this.dH))
                            {
                                return true;
                            }
                        }
                        return flag;
                }
                return flag;
            }

            private bool CheckSlowReaction()
            {
                bool flag = false;
                if (this.prm.CheckSlowReac_kind != 0)
                {
                    int num = this.prm.CoagDetPercent - (this.prm.SRcheckWidth / 2);
                    int num2 = this.prm.CoagDetPercent + (this.prm.SRcheckWidth / 2);
                    if (!this.Check_chkP(num2 - 1) || !this.Check_chkP(num - 1))
                    {
                        return flag;
                    }
                    double num3 = this.ana_data[num2 - 1] - this.ana_data[num - 1];
                    if (num3 > (this.prm.SRwidthMaxTime * this.t_para_rate))
                    {
                        flag = true;
                    }
                }
                return flag;
            }

            private bool CheckSpeedChangeDetection()
            {
                bool flag = true;
                double num = 24.0;
                double num2 = 6.4;
                for (int i = 0; i < base.anaOptData.Length; i++)
                {
                    if ((i > ((int) ((num2 + 1.8) * 10.0))) && (i < (base.anaOptData.Length - ((int) (num2 * 10.0)))))
                    {
                        double num3 = base.anaOptData[i] - base.anaOptData[i - ((int) (num2 * 10.0))];
                        double num4 = base.anaOptData[i + ((int) (num2 * 10.0))] - base.anaOptData[i];
                        if ((num3 < -24.0) && (num4 >= 0.0))
                        {
                            num4 += Math.Abs(num3);
                            num3 = num;
                        }
                        if (num3 < num)
                        {
                            num3 = num;
                        }
                        if (num4 < num)
                        {
                            num4 = num;
                        }
                        if (((num4 / num3) > this.prm.SR2Ratio) && (base.anaOptData[i] < ((((double) (this.dH * this.prm.CoagDetPercent)) / 100.0) + this.min)))
                        {
                            flag = false;
                        }
                    }
                }
                return flag;
            }

            private int CheckStartAngle()
            {
                int num = 0;
                int num2 = (int) (this.prm.SAngleCheck_time1 * this.t_para_rate);
                if (num2 < 0)
                {
                    num2 = 0;
                }
                else if (num2 >= base.anaOptData.Length)
                {
                    num2 = base.anaOptData.Length - 1;
                }
                int num3 = (int) (this.prm.SAngleCheck_time2 * this.t_para_rate);
                if (num3 < 0)
                {
                    num3 = 0;
                }
                else if (num3 >= base.anaOptData.Length)
                {
                    num3 = base.anaOptData.Length - 1;
                }
                if (num2 > num3)
                {
                    int num4 = num2;
                    num2 = num3;
                    num3 = num4;
                }
                int num5 = num2;
                int num6 = 0;
                int num7 = num3;
                int num8 = 0x186a0;
                if ((num2 >= base.anaOptData.Length) || (num3 >= base.anaOptData.Length))
                {
                    return num;
                }
                for (int i = num2; i <= num3; i++)
                {
                    if (num8 > base.anaOptData[i])
                    {
                        num7 = i;
                        num8 = base.anaOptData[i];
                    }
                    else if (num6 < base.anaOptData[i])
                    {
                        num5 = i;
                        num6 = base.anaOptData[i];
                    }
                }
                if ((num7 >= num5) || ((num6 - num8) < this.prm.SAngleDelta_th))
                {
                    return num;
                }
                if (this.dH <= this.prm.SAngleDH_th)
                {
                    return 1;
                }
                return 2;
            }

            private bool CheckStartProfilePROC()
            {
                bool flag = false;
                int num = (int) (this.prm.SPcheckTime1 * this.t_para_rate);
                if (num < 0)
                {
                    num = 0;
                }
                else if (num >= base.anaOptData.Length)
                {
                    num = base.anaOptData.Length - 1;
                }
                int num2 = (int) (this.prm.SPcheckTime2 * this.t_para_rate);
                if (num2 < 0)
                {
                    num2 = 0;
                }
                else if (num2 >= base.anaOptData.Length)
                {
                    num2 = base.anaOptData.Length - 1;
                }
                if (num > num2)
                {
                    int num3 = num;
                    num = num2;
                    num2 = num3;
                }
                int num4 = num;
                int num5 = 0;
                int num6 = num2;
                int num7 = 0x186a0;
                int num8 = -1;
                if ((num < base.anaOptData.Length) && (num2 < base.anaOptData.Length))
                {
                    for (int i = num; i <= num2; i++)
                    {
                        if (num7 > base.anaOptData[i])
                        {
                            num6 = i;
                            num7 = base.anaOptData[i];
                        }
                        else if (num5 < base.anaOptData[i])
                        {
                            num4 = i;
                            num5 = base.anaOptData[i];
                        }
                    }
                    num8 = num5 - num7;
                    if (this.dH <= 0)
                    {
                        return flag;
                    }
                    if ((num6 < num4) && ((((double) num8) / ((double) this.dH)) >= this.prm.SPcheckLimitRatio))
                    {
                        flag = true;
                    }
                }
                return flag;
            }

            private bool CheckStep(int flat_index)
            {
                bool flag = false;
                switch (this.prm.CheckStep_kind)
                {
                    case 1:
                    case 2:
                        flag = this.CheckStepCurve(flat_index);
                        break;
                }
                bool result;
                if (this.prm.CheckStep_kind == 2)
                {
                    bool flag2 = this.CheckStepCuveNextEnd(flat_index);
                    result = (flag && flag2);
                }
                else
                {
                    result = flag;
                }
                return result;
            }

            private bool CheckStepCurve(int flat_index)
            {
                int[] numArray = new int[] { (int) (this.prm.StepCheck_time1 * this.t_para_rate), (int) (this.prm.StepCheck_time2 * this.t_para_rate) };
                int num = (int) (this.prm.StepCheckRatio_th * 10.0);
                for (int i = 0; i < numArray.Length; i++)
                {
                    int index = numArray[i];
                    if (index >= base.anaOptData.Length)
                    {
                        index = base.anaOptData.Length - 1;
                    }
                    int num4 = 0;
                    for (int j = this.coag_p; j <= this.flat_p; j++)
                    {
                        if (num4 < base.anaOptData[j])
                        {
                            num4 = base.anaOptData[j];
                        }
                    }
                    int num6 = num4 - this.min;
                    if (num6 == 0)
                    {
                        num6 = 1;
                    }
                    int num7 = base.anaOptData[index] - this.min;
                    int num8 = (10 * num7) / num6;
                    if ((this.dH != 0) && ((flat_index < numArray[i]) && (((num7 - num6) > this.prm.StepCheckDiff_th) && (num8 > num))))
                    {
                        return true;
                    }
                }
                return false;
            }

            private bool CheckStepCurveNew(int flat_index)
            {
                bool flag = false;
                double num = 0.0;
                double num2 = 0.0;
                int num3 = 0;
                int num4 = 0;
                for (int i = flat_index; i < base.anaOptData.Length; i++)
                {
                    num2 += base.anaOptData[i];
                    num3++;
                }
                if (num3 > 0)
                {
                    num = num2 / ((double) num3);
                    num4 = ((int) num) - this.min;
                }
                if ((this.dH != 0) && ((num4 / this.dH) > this.prm.StepRate_th))
                {
                    flag = true;
                }
                return flag;
            }

            private bool CheckStepCuveNextEnd(int flat_index)
            {
                bool flag = false;
                int num2 = flat_index;
                if (num2 < (0x12 + this.prm.EndJudge1_Width))
                {
                    num2 = 0x12 + this.prm.EndJudge1_Width;
                }
                for (int i = num2; i < this.wrkJudgeHeight.Length; i++)
                {
                    if (this.wrkJudgeHeight[i])
                    {
                        flag = true;
                    }
                }
                return flag;
            }

            private bool CheckTerrace()
            {
                int num = 0;
                int num3 = this.ana_data[this.prm.CoagDetPercent - 1];
                int num2 = (int) Math.Round((double) (num3 * this.prm.Terrace_th), 0);
                for (int i = this.prm.TerraceCheckStart; i < (this.prm.TerraceCheckEnd - 1); i++)
                {
                    num = this.ana_data[i + 1] - this.ana_data[i];
                    if ((num >= num2) && (num >= this.prm.DipPoint_th))
                    {
                        return true;
                    }
                }
                return false;
            }

            private int Correct_DH()
            {
                int num = ((this.dH - this.prm.DH_BASE) / this.prm.DH_DIS) * ((int) (this.prm.DH_COR * this.t_para_rate));
                if (num < 0)
                {
                    return 0;
                }
                if (num > ((int) (this.prm.DH_MAXTIME * this.t_para_rate)))
                {
                    num = (int) (this.prm.DH_MAXTIME * this.t_para_rate);
                }
                return num;
            }

            private void CreatCoagData()
            {
                int num = ((int) (this.prm.MaskTime * this.t_para_rate)) + 1;
                int num2 = (int) (this.prm.bH_SearchTime * this.t_para_rate);
                int num3 = 0;
                double dH = 0.0;
                double num5 = 0.0;
                double num6 = 0.0;
                if (num2 >= base.anaOptData.Length)
                {
                    num2 = base.anaOptData.Length - 1;
                }
                int num7 = 0;
                int index = 0;
                for (index = num; index <= num2; index++)
                {
                    if (this.min > base.anaOptData[index])
                    {
                        this.min = base.anaOptData[index];
                        this.min_p = index;
                        this.flat_p = this.min_p;
                    }
                }
                int coagStartLevel = this.prm.CoagStartLevel;
                do
                {
                    int num10 = 0;
                    for (index = this.min_p; index < base.anaOptData.Length; index++)
                    {
                        num7 = base.anaOptData[index] - this.min;
                        if (num7 > coagStartLevel)
                        {
                            num10++;
                        }
                        else if ((num7 < coagStartLevel) && (num10 > 0))
                        {
                            num10--;
                        }
                        if (num10 > this.prm.CoagCount)
                        {
                            this.coag_p = index;
                            this.coag_search_f = true;
                            break;
                        }
                    }
                    if (!this.coag_search_f)
                    {
                        break;
                    }
                    index = this.coag_p;
                    while (index < base.anaOptData.Length)
                    {
                        if (this.max < base.anaOptData[index])
                        {
                            this.max = base.anaOptData[index];
                            this.max_p = index;
                        }
                        if (this.SearchFlat(index))
                        {
                            this.flat_search_f = true;
                            break;
                        }
                        index++;
                    }
                    if (index < base.anaOptData.Length)
                    {
                        this.dH = this.max - this.min;
                        if (this.prm.CheckStep_kind == 2)
                        {
                            if (num3 == 0)
                            {
                                dH = this.dH;
                            }
                            else
                            {
                                num5 = this.dH;
                            }
                            num3++;
                        }
                        if (!this.CheckStep(this.flat_p))
                        {
                            break;
                        }
                        this.flat_search_f = false;
                        this.coag_search_f = false;
                        int maxValue = this.GetMaxValue(this.flat_p);
                        coagStartLevel = (this.dH + (maxValue - this.min)) / 2;
                        if (this.prm.CheckStep_kind == 1)
                        {
                            this.res.AddError(350);
                        }
                    }
                }
                while ((index < base.anaOptData.Length) && !this.flat_search_f);
                if ((this.prm.CheckStep_kind == 2) && (num3 > 1))
                {
                    num6 = ((double) (this.prm.CoagDetPercent - 10)) / 100.0;
                    if ((dH / num5) >= num6)
                    {
                        this.res.AddError(350);
                    }
                }
                if (!this.flat_search_f || (index >= base.anaOptData.Length))
                {
                    if (this.coag_search_f && this.prm.CheckNoEnd_flag)
                    {
                        this.res.AddError(200);
                        this.flat_p = base.anaOptData.Length - 1;
                    }
                    this.dH = this.math_tool.CalMedienVal(base.anaOptData, this.flat_p - 0x10, this.flat_p) - this.min;
                    if (this.flat_p == this.min_p)
                    {
                        this.dH = 0;
                    }
                }
                if (this.dH < 0)
                {
                    this.dH = 0;
                }
            }

            private bool DataSmooth(uint wave, uint kind, uint gain)
            {
                base.anaOptDataOrg = this.raw.GetOptData(wave, kind, gain);
                if ((base.anaOptDataOrg == null) || (base.anaOptDataOrg.Length <= 0))
                {
                    return false;
                }
                base.anaOptData = this.raw.GetOptData(wave, kind, gain);
                if (this.prm.RefTranFlag)
                {
                    uint detOptKind = 0;
                    switch (kind)
                    {
                        case 1:
                            detOptKind = 2;
                            break;

                        case 2:
                            detOptKind = 1;
                            break;
                    }
                    ushort[] refData = this.raw.GetOptData(wave, detOptKind, gain);
                    base.anaOptData = this.prm.GetRefTranAD(base.anaOptData, refData);
                }
                if (this.prm.SmoothFlag_Medien)
                {
                    base.anaOptData = this.prm.GetMedienSmoothOptData(base.anaOptData, this.prm.Medien_BeforeP, this.prm.Medien_AfterP);
                }
                if (this.prm.SmoothFlag_ShiftAve)
                {
                    base.anaOptData = this.prm.GetShiftAveSmoothOptData(base.anaOptData, this.prm.ShiftAve_BeforeP, this.prm.ShiftAve_AfterP);
                    if (this.prm.CheckStep_kind == 2)
                    {
                        this.anaOptDataWrk = new ushort[base.anaOptData.Length];
                        Array.Copy(base.anaOptData, this.anaOptDataWrk, base.anaOptData.Length);
                        this.CheckFlat_JudgeHight();
                    }
                }
                if (kind == 1)
                {
                    this.reverce_ad = base.anaOptData;
                    base.anaOptData = this.prm.GetReverseOptData(base.anaOptData);
                    this.reverce_f = true;
                }
                return true;
            }

            private int GetMaxValue(int index)
            {
                int num = 0;
                for (int i = index; i < base.anaOptData.Length; i++)
                {
                    if (num < base.anaOptData[i])
                    {
                        num = base.anaOptData[i];
                    }
                }
                return num;
            }

            private double GetRevisionTime(double time)
            {
                int val = (int) (time * this.t_para_rate);
                if (this.prm.ApplyCorrectDH)
                {
                    val -= this.Correct_DH();
                }
                if (this.prm.ApplyCalibReag)
                {
                    val = base.calibReag.CalInt10(val);
                }
                if (this.res.MicroFlag)
                {
                    val = base.calibFomura0Micro.CalInt10(val);
                }
                if (this.prm.ApplyCalibFomura0)
                {
                    val = base.calibFomura0.CalInt10(val);
                }
                if (this.prm.ApplyCalibFomura1)
                {
                    val = base.calibFomura1.CalInt10(val);
                }
                return (val * this.t_para);
            }

            private int GetWaveString(uint wave)
            {
                int num;
                uint num2 = 2;
                uint num3 = 3;
                uint num4 = 4;
                uint num5 = 5;
                uint num6 = 6;
                if (wave == num2)
                {
                    num = 0x195;
                    this.res.AddError(0x1905);
                    return num;
                }
                if (wave == num3)
                {
                    num = 0x23f;
                    this.res.AddError(0x19af);
                    return num;
                }
                if (wave == num4)
                {
                    num = 660;
                    this.res.AddError(0x1a04);
                    return num;
                }
                if (wave == num5)
                {
                    num = 800;
                    this.res.AddError(0x1a90);
                    return num;
                }
                if (wave == num6)
                {
                    num = 340;
                    this.res.AddError(0x18c4);
                    return num;
                }
                return -1;
            }

            private bool IsFlat(int index)
            {
                bool flag = false;
                int num = index + this.prm.EndJudge1_Width;
                if (num > 0x4b0)
                {
                    num += this.prm.EndJudge1_Width;
                    if (num > 0x960)
                    {
                        num += this.prm.EndJudge1_Width * 8;
                    }
                }
                if (num < base.anaOptData.Length)
                {
                    int num2 = base.anaOptData[index];
                    int num3 = 0;
                    num3 = index + 1;
                    while (num3 <= num)
                    {
                        if (this.max < base.anaOptData[num3])
                        {
                            this.max = base.anaOptData[num3];
                            this.max_p = num3;
                        }
                        if ((base.anaOptData[num3] - num2) > this.prm.EndJudge1_Height)
                        {
                            break;
                        }
                        num3++;
                    }
                    if (num3 > num)
                    {
                        this.flat_p = num;
                        flag = true;
                    }
                }
                return flag;
            }

            private bool IsFlatAreaMethod(int index)
            {
                bool flag = false;
                int num = 0;
                int num2 = 0;
                int num3 = 0;
                int num4 = 0;
                num = index - this.prm.EndJudge_dHCount;
                num3 = index;
                num2 = index;
                num4 = index + this.prm.EndJudge_dHCount;
                if (((num >= this.coag_p) && (num > ((int) ((this.prm.MaskTime * this.t_para_rate) + 1.0)))) && (num4 < base.anaOptData.Length))
                {
                    double num5 = base.anaOptData[num3] - base.anaOptData[num];
                    double num6 = base.anaOptData[num4] - base.anaOptData[num2];
                    double num7 = 2.0 * (this.max - this.min);
                    double num8 = this.prm.EndJudge_dH * 0.01;
                    if ((num7 + num6) >= (num8 * (num7 - num5)))
                    {
                        return flag;
                    }
                    double slope = 0.0;
                    if (this.math_tool.CalSlope(num, num3, base.anaOptData, this.t_para, ref slope))
                    {
                        return flag;
                    }
                    double num10 = 0.0;
                    if (this.math_tool.CalSlope(num2, num4, base.anaOptData, this.t_para, ref num10))
                    {
                        return flag;
                    }
                    double num11 = ((double) -this.prm.SDrop_th) / (this.prm.EndJudge_dHCount * this.t_para);
                    if ((num10 <= num11) || (slope <= num11))
                    {
                        return flag;
                    }
                    num7 = 2.0 * (this.max - this.min);
                    num5 = (slope * this.prm.EndJudge_dHCount) * this.t_para;
                    num6 = (num10 * this.prm.EndJudge_dHCount) * this.t_para;
                    if ((num7 + num6) < (num8 * (num7 - num5)))
                    {
                        this.flat_p = index;
                        flag = true;
                    }
                }
                return flag;
            }

            private bool IsFlatSlopeMethod(int index)
            {
                bool flag = false;
                int num = 0;
                int num2 = 0;
                int num3 = 0;
                int num4 = 0;
                double num5 = 0.0;
                double num6 = 0.0;
                num = this.coag_p;
                num3 = index;
                if (num3 != num)
                {
                    num5 = ((double) (base.anaOptData[num3] - base.anaOptData[num])) / ((num3 - num) * this.t_para);
                }
                num2 = index;
                num4 = index + (index - num);
                if (num4 >= base.anaOptData.Length)
                {
                    num4 = base.anaOptData.Length - 1;
                }
                if (num4 != num2)
                {
                    num6 = ((double) (base.anaOptData[num4] - base.anaOptData[num2])) / ((num4 - num2) * this.t_para);
                }
                if ((num5 != 0.0) && (num6 != 0.0))
                {
                    if ((num6 / num5) >= this.prm.EndJudge2_Rate)
                    {
                        return flag;
                    }
                    double slope = 0.0;
                    if (this.math_tool.CalSlope(num, num3, base.anaOptData, this.t_para, ref slope))
                    {
                        return flag;
                    }
                    num5 = slope;
                    if (this.math_tool.CalSlope(num2, num4, base.anaOptData, this.t_para, ref slope))
                    {
                        return flag;
                    }
                    num6 = slope;
                    if ((num6 <= 0.0) || (num5 <= 0.0))
                    {
                        return flag;
                    }
                    if ((num6 / num5) < this.prm.EndJudge2_Rate)
                    {
                        this.flat_p = index;
                        flag = true;
                    }
                }
                return flag;
            }

            private bool MakeAnalysisData()
            {
                bool flag = false;
                int num = 0;
                int index = this.min_p;
                int num4 = 0;
                for (int i = 1; i <= 100; i++)
                {
                    int num2 = 0;
                    num = ((this.dH * i) / 100) + this.min;
                    while (index <= this.flat_p)
                    {
                        if (num < base.anaOptData[index])
                        {
                            num2++;
                            num4 = index;
                        }
                        else if (num2 > 1)
                        {
                            num2--;
                        }
                        if (num2 >= this.prm.CoagDetCount)
                        {
                            break;
                        }
                        if ((this.prm.CheckDip_flag && ((i >= this.prm.DipCheckStart) && (i <= this.prm.DipCheckEnd))) && ((index - num4) > this.prm.DipPoint_th))
                        {
                            flag = true;
                        }
                        index++;
                    }
                    this.ana_data[i - 1] = index - num2;
                    if (this.ana_data[i - 1] >= base.anaOptData.Length)
                    {
                        this.ana_data[i - 1] = base.anaOptData.Length - 1;
                    }
                    index = this.ana_data[i - 1];
                    this.ana_data_realTime[i - 1] = this.ana_data[i - 1];
                    if (this.prm.ApplyCorrectDH)
                    {
                        this.ana_data[i - 1] -= this.Correct_DH();
                    }
                    if (this.prm.ApplyCalibReag)
                    {
                        this.ana_data[i - 1] = base.calibReag.CalInt10(this.ana_data[i - 1]);
                    }
                    if (this.res.MicroFlag)
                    {
                        this.ana_data[i - 1] = base.calibFomura0Micro.CalInt10(this.ana_data[i - 1]);
                    }
                    if (this.prm.ApplyCalibFomura0)
                    {
                        this.ana_data[i - 1] = base.calibFomura0.CalInt10(this.ana_data[i - 1]);
                    }
                    if (this.prm.ApplyCalibFomura1)
                    {
                        this.ana_data[i - 1] = base.calibFomura1.CalInt10(this.ana_data[i - 1]);
                    }
                }
                return flag;
            }

            private void MakeDerivativeAnalysis()
            {
                this.min1 = this.min2 = this.max2 = 0.0;
                this.min1_p = this.min2_p = this.max2_p = 0;
                bool errFlag = false;
                int length = base.anaOptData.Length;
                double[] data = new double[length];
                float num6 = 1.8f;
                num6++;
                int num7 = (int) (this.GetRevisionTime((double) num6) * this.t_para_rate);
                if (num7 < 0)
                {
                    num7 = 0;
                }
                this.res.AnaInfoList.Add("Limit_Start_pos=" + num7.ToString("0000"));
                int width = this.prm.Derivative_Width;
                this.res.AnaInfoList.Add("Derivative_Width=" + width.ToString("0000"));
                int num9 = (int) (this.GetRevisionTime(this.prm.MaskTime) * this.t_para_rate);
                this.res.AnaInfoList.Add("MaskTime=" + num9.ToString("0000"));
                if (this.dH == 0)
                {
                    errFlag = true;
                }
                else
                {
                    int index = (int) (this.GetRevisionTime(this.min_p * this.t_para) * this.t_para_rate);
                    ushort standard = this.res.AnaOptData[index];
                    this.anaOptDataRel = this.math_tool.RelativeLevel(this.res.AnaOptData, standard, out errFlag);
                    if (!errFlag)
                    {
                        this.math_tool.Start_pos = num7;
                        this.anaOptDataRelSmooth = this.math_tool.ShiftAverage(this.anaOptDataRel, width, out errFlag);
                        if (!errFlag)
                        {
                            this.math_tool.End_pos = 0;
                            this.anaOptDataDeriv1 = this.math_tool.ShiftCalSlope(this.anaOptDataRelSmooth, this.t_para, width, out errFlag);
                            data = this.math_tool.ShiftCalSlopeRaw(this.anaOptDataRelSmooth, this.t_para, width, out errFlag);
                            if (!errFlag)
                            {
                                int end = (int) (this.GetRevisionTime(this.flat_p * this.t_para) * this.t_para_rate);
                                this.min1 = this.math_tool.MinValue(this.anaOptDataDeriv1, index, end, out this.min1_p);
                                this.min1 = -this.min1;
                                double num13 = ((double) this.min1_p) / ((double) this.t_para_rate);
                                this.res.AnaInfoList.Add("min1=" + this.min1.ToString("0.00000") + "  (" + num13.ToString("###0.0") + ")");
                                int num14 = 10;
                                this.math_tool.Start_pos = num7 + num14;
                                this.math_tool.End_pos = width / 2;
                                this.anaOptDataDeriv2 = this.math_tool.ShiftCalSlope(data, this.t_para, width, out errFlag);
                                if (!errFlag)
                                {
                                    int num4 = this.ana_data[this.prm.CoagDetPercent - 1];
                                    this.min2 = this.math_tool.MinValue(this.anaOptDataDeriv2, index, num4, out this.min2_p);
                                    this.min2 = -this.min2;
                                    double num15 = ((double) this.min2_p) / 10.0;
                                    this.res.AnaInfoList.Add("min2=" + this.min2.ToString("0.00000") + "  (" + num15.ToString("###0.0") + ")");
                                    this.max2 = this.math_tool.MaxValue(this.anaOptDataDeriv2, num4, end, out this.max2_p);
                                    double num16 = ((double) this.max2_p) / 10.0;
                                    this.res.AnaInfoList.Add("max2=" + this.max2.ToString("0.00000") + "  (" + num16.ToString("###0.0") + ")");
                                }
                            }
                        }
                    }
                }
            }

            private bool SearchFlat(int index)
            {
                bool flag = false;
                switch (this.prm.EndJudge_Kind)
                {
                    case 1:
                        return this.IsFlat(index);

                    case 2:
                        if (index > (this.coag_p + 0x40))
                        {
                            flag = this.IsFlatSlopeMethod(index);
                        }
                        return flag;

                    case 3:
                        return this.IsFlatAreaMethod(index);
                }
                return flag;
            }

            private void Set_AnaWorkParamDef()
            {
                this.res = new AnaResult();
                this.coagTimeFlag = new ArrayList();
                this.deltaHFlag = new ArrayList();
                this.analyzeInfoList = new ArrayList();
                this.sampleInfoList = new ArrayList();
                this.math_tool = new AnaMathTool();
                this.min = 0xfff;
                this.min_p = 0;
                this.max = 0;
                this.max_p = 0;
                this.flat_search_f = false;
                this.flat_p = 0;
                this.coag_p = 0;
                this.coag_search_f = false;
                this.dH = 0;
                this.reverce_f = false;
                this.t_para = 0.1;
                this.t_para_rate = 10;
                this.ana_data = new int[100];
                this.ana_data_realTime = new int[100];
                base.calibReag.ValA = this.prm.calibReagValA;
                base.calibReag.ValB = this.prm.calibReagValB;
                base.calibFomura0.ValA = this.prm.calibFomura0ValA;
                base.calibFomura0.ValB = this.prm.calibFomura0ValB;
                base.calibFomura0Micro.ValA = this.prm.calibFomura0MicroValA;
                base.calibFomura0Micro.ValB = this.prm.calibFomura0MicroValB;
                base.calibFomura1.ValA = this.prm.calibFomura1ValA;
                base.calibFomura1.ValB = this.prm.calibFomura1ValB;
                this.waveChange_f = false;
            }

            private void SetAnaRestultERR(int err)
            {
                this.res.DateTimeAnalysis = DateTime.Now;
                this.res.AnaOptDataOrg = new ushort[0];
                this.res.AnaOptData = new ushort[0];
                this.res.AnaOptCycle = (float) this.t_para;
                this.res.AnaOptValidSec = (float) (this.res.AnaOptData.Length * this.t_para);
                this.res.SampInfoList = this.res.SetSampleInfo(this.raw);
                double val = -1.0;
                AnaValue value2 = new AnaValue(1, val, "0000.0", this.coagTimeFlag);
                this.res.AddResult(ResultItem.sec.ToString(), value2);
                if (err == 1)
                {
                    this.res.AddError((int) this.raw.ErrorInfo);
                }
                else
                {
                    this.res.AddError(2);
                    MessageBox.Show("未定義のエラーが発生しました");
                }
            }

            private void SetAnaRestultErrPriority()
            {
                this.res.SetErrorPriority(this.raw.SampleKind);
            }

            private void SetAnaResult()
            {
                this.res.DateTimeAnalysis = DateTime.Now;
                this.res.AnaOptDataOrg = base.anaOptDataOrg;
                if (this.reverce_f)
                {
                    this.res.AnaOptData = this.reverce_ad;
                }
                else
                {
                    this.res.AnaOptData = base.anaOptData;
                }
                double a = 1.0;
                double b = 0.0;
                if (this.prm.ApplyCorrectDH)
                {
                    b = (-1.0 * this.t_para) * this.Correct_DH();
                }
                if (this.prm.ApplyCalibReag)
                {
                    a *= base.calibReag.ValA;
                    b = (b * base.calibReag.ValA) + base.calibReag.ValB;
                }
                if (this.res.MicroFlag)
                {
                    a *= base.calibFomura0Micro.ValA;
                    b = (b * base.calibFomura0Micro.ValA) + base.calibFomura0Micro.ValB;
                }
                if (this.prm.ApplyCalibFomura0)
                {
                    a *= base.calibFomura0.ValA;
                    b = (b * base.calibFomura0.ValA) + base.calibFomura0.ValB;
                }
                if (this.prm.ApplyCalibFomura1)
                {
                    a *= base.calibFomura1.ValA;
                    b = (b * base.calibFomura1.ValA) + base.calibFomura1.ValB;
                }
                this.res.AnaOptData = this.math_tool.MakeDataArray(this.res.AnaOptData, a, b, (double) this.t_para_rate);
                this.res.AnaData = this.ana_data;
                int num3 = (((int) ((this.flat_p * this.t_para) / 60.0)) + 1) * (60 * this.t_para_rate);
                if (num3 >= base.anaOptData.Length)
                {
                    this.res.AnaOptValidSec = (float) ((base.anaOptData.Length - 1) * this.t_para);
                }
                else
                {
                    this.res.AnaOptValidSec = (float) (num3 * this.t_para);
                }
                this.res.AnaOptCycle = (float) this.t_para;
                this.res.SampInfoList = this.res.SetSampleInfo(this.raw);
                this.res.AnaInfoList = this.analyzeInfoList;
                double revisionTime = this.GetRevisionTime(this.min_p * this.t_para);
                this.res.AnaInfoList.Add("bHPointTime=" + revisionTime.ToString("###0.0"));
                int index = (int) (revisionTime * this.t_para_rate);
                ushort num6 = this.res.AnaOptData[index];
                this.res.AnaInfoList.Add("bH=" + num6.ToString());
                double num7 = this.GetRevisionTime(this.flat_p * this.t_para);
                this.res.AnaInfoList.Add("EndPointTime=" + num7.ToString("###0.0"));
                this.res.AnaInfoList.Add("dH=" + this.dH.ToString());
                this.res.AnaInfoList.Add("coagDetPoint=" + this.prm.CoagDetPercent.ToString());
                double val = this.ana_data[this.prm.CoagDetPercent - 1] * this.t_para;
                AnaValue value2 = new AnaValue(1, val, "0000.0", this.coagTimeFlag);
                this.res.AddResult(ResultItem.sec.ToString(), value2);
                if (this.waveChange_f)
                {
                    this.dH = -1;
                }
                AnaValue value3 = new AnaValue(3, (double) this.dH, "0000", this.deltaHFlag);
                this.res.AddResult(ResultItem.dH.ToString(), value3);
                double num9 = this.Calc_dOD();
                this.res.AnaInfoList.Add("dOD=" + num9.ToString("0.0000"));
                if (this.waveChange_f)
                {
                    num9 = -1.0;
                }
                AnaValue value4 = new AnaValue(4, num9, "0.0000", this.coagTimeFlag);
                this.res.AddResult(ResultItem.dOD.ToString(), value4);
                if (this.prm.CheckFlatCurve)
                {
                    this.res.AnaInfoList.Add("ClottingPointSlope=" + this.coagPointSlope.ToString("##0.00"));
                }
                this.SetPointInfo();
                this.SetLineInfo();
            }

            private void SetInfoAnaResult()
            {
                base.HILJudgement(this.raw, ref this.res);
                base.VolJudgement(this.raw, ref this.res);
                this.res.YaxisMax = 0xfff;
                this.res.YaxisMin = 0;
                this.res.SampleID = this.raw.SampleID;
                this.res.SampleKind = this.raw.SampleKind;
                this.res.DetOptWave = this.prm.DetOptWave;
                this.res.DetOptKind = this.prm.DetOptKind;
                this.res.DetOptGain = this.prm.DetOptGain;
                this.res.AnaAlgoID = this.prm.AnaAlgoID;
                this.res.DilutionID = this.raw.DilutionID;
                if (this.raw.DilutionRate.m == 0)
                {
                    this.res.DilutionRate = new Fraction((long) this.raw.DilutionRate.n, 1L);
                }
                else
                {
                    this.res.DilutionRate = new Fraction((long) this.raw.DilutionRate.n, (long) this.raw.DilutionRate.m);
                }
                this.res.MdaPattern = this.raw.DilutionRate.mdaPtn;
                this.res.MicroFlag = this.raw.MicroFlag;
                if (this.prm.CheckAgedSamp_flag)
                {
                    this.res.AgedFlag = this.res.Check_AgedSample(this.raw.GetDateTimeAspi(), this.raw.GetDateTimeDisp());
                    if (this.res.AgedFlag)
                    {
                        this.res.AddError(3);
                    }
                }
                this.res.MachineID = this.raw.MachineID;
                this.res.DateTimeMeas = this.raw.GetDateTimeDisp();
                this.res.DetChannel = this.raw.DetChannel;
                this.res.DetTemperature = this.raw.DetTemperature;
                if ((this.raw.WarningInfo & 1) == 0)
                {
                    this.res.TempErrorFlag = false;
                }
                else
                {
                    this.res.TempErrorFlag = true;
                }
                this.res.MeasReagInfo = this.raw.MeasReagInfo;
            }

            private void SetLineInfo()
            {
                int num = 1;
                int start = (int) (this.GetRevisionTime(this.prm.MaskTime) * this.t_para_rate);
                int num7 = this.math_tool.MinValue(this.res.AnaOptData, start, this.res.AnaOptData.Length - 1);
                int num8 = this.math_tool.MaxValue(this.res.AnaOptData, start, this.res.AnaOptData.Length - 1);
                int index = (int) (this.GetRevisionTime(this.min_p * this.t_para) * this.t_para_rate);
                int num10 = (int) (this.GetRevisionTime(this.flat_p * this.t_para) * this.t_para_rate);
                int num2 = start;
                int num4 = this.res.AnaOptData[index];
                int num3 = this.res.AnaOptData.Length - 1;
                int num5 = num4;
                string str = string.Format("{0},{1},{2},{3},{4}", new object[] { num, num2, num4, num3, num5 });
                this.res.LineInfo.Add(str);
                num2 = index;
                num4 = num7;
                num3 = num2;
                num5 = num8;
                string str2 = string.Format("{0},{1},{2},{3},{4}", new object[] { num, num2, num4, num3, num5 });
                this.res.LineInfo.Add(str2);
                num2 = num10;
                num4 = num7;
                num3 = num2;
                num5 = num8;
                string str3 = string.Format("{0},{1},{2},{3},{4}", new object[] { num, num2, num4, num3, num5 });
                this.res.LineInfo.Add(str3);
            }

            private void SetPointInfo()
            {
                int num = 1;
                int index = this.ana_data[this.prm.CoagDetPercent - 1];
                if (index >= this.res.AnaOptData.Length)
                {
                    index = this.res.AnaOptData.Length - 1;
                }
                int num3 = this.res.AnaOptData[index];
                string str = string.Format("{0},{1},{2},{3}", new object[] { num, index, num3, "Ana_Res_CoagPoint" });
                this.res.PointInfo.Add(str);
            }
        }
    }
}

